i would like to select * from table where dates between (some_date and another_date)
the problem is that the dates are stored as varchar!
here are examples of dates that i have:
7/29/2010 9:53 AM
7/16/2010 7:57:39 AM
please notice that some records have seconds and some do not
i dont care about the time at all i just need the date
...
i would like to get all the characters in a field before the blank
if field1 = "chara ters"
i want it to return chara
what would this select statement look like?
...
I'm learning php through head first's php and mysql and I'm toying with the simplest of php scripts: data from a form is inserted into a mysql database. I have modified the example from chapter two to use it on my own form and db, but I haven't been able to make the db accept anything I write into the form.
Where's the error?
Here's ...
I have looked all over and found no solution, any help on this would be great.
Query:
LOAD DATA INFILE '/Users/name/Desktop/loadIntoDb/loadIntoDB.csv'
INTO TABLE `tba`.`tbl_name`
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(
field1, field2, field3
)
Error:
Can't get stat of '/Users/name/Desktop/loadIntoDb/lo...
The title might be worded strange, but it's probably because I don't even know if I'm asking the right question.
So essentially what I'm trying to build is a "breadcrumbish" categoricalization type system (like a file directory) where each node has a parent (except for root) and each node can contain either data or another node. This w...
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 10.0.6.55
Master_User: slave_user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bi...
I'm using FULLTEXT natural language search, and I notice that it automatically sorts my results by relevance. However, when I start to add things to ORDER, it seems to no longer sort by relevance. Is there a way to explicitly set the importance of relevance sorting?
...
When i try so sort my output to DESC, i get this error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in
This is my line:
$queryForWall = mysql_query("SELECT * FROM users_wall WHERE uID = '$showU[id]' DESC");
while($displayWall = mysql_fetch_array($queryForWall)){
As you can see i added DESC there, ...
I have a MySQL table which has three columns:
Authority | MapID | Time
---------------------------------------------------------
animuson@forums | 000000000000000 | 45.6758
132075829385895 | 000000000000000 | 49.7869
qykumsoy@forums | 000000000000000 | 44.45
439854390263565...
Hello,
I am having problems using MySQL's fulltext search and returning the results in order by relevance. I have to use boolean full text search, which does not return results in order by relevance. However, I need these results in order of relevance. If I attempt to add an order by clause on the end of the query, the query results to ...
I am having trouble writing a query on a mysql table of user activity that will give me a breakdown of how active our users are. The table structure is like so:
CREATE TABLE IF NOT EXISTS `ca_activity` (
`id` bigint(20) NOT NULL auto_increment,
`user_id` bigint(20) default NULL,
`activity_type` varchar(50) collate utf8_unicode_ci...
Ok. Here is what I'm trying to accomplish.
I am saving the changes to a forms textarea so that all the changes that have been made to that textarea can be viewed. Like a string of comments. I've gotten the data into the two tables. I need help getting it back out.
I have data in two tables "worklog" and "worklognotes".
worklog is a ser...
Ive got tables that store geo location data as type 'Geometry' Ive done a mysql dump and loaded the same database onto my local server.
Now when running the exact same query on both servers Im getting different results. The query converts the geo raw data to proper lat and lng results.
On the live server I get something like : '-33.914...
Hi,
How can I combine 2 group by conditions? I have records for each id for every hour in a day and I want to group information by first id and all records for that id in that day then second id and all records for that in the day.
My sample query is this:
SELECT
r.name
, r.network
, r.namestring
, i.name
, i.description
,...
Hi, I am trying to pull multiple columns from 3 joined tables, but I want the result set to contain only one distinct "data entry" per p.id (the pet id which is a foreign key in the data entry table). The issue i have is that there could be two data entries, numbered 1 and 2, belonging to a pet - the query has to just pick the data entry...
Hi,
i have 2 tables called user, with the fileds user.userID and user.lastActivityTime, and session with the same fields. Now i want to get an user by ID but if there is an entry in the sessionTable with the same userID i want to get all from user but the lastActivityTime from session. How can I do this?
Thank You
...
Hello,
I've created a Java application that is split in different subcomponents, each of those runs on a separate Tomcat instance. Also, some components use a MySQL db through Hibernate.
I'm now creating an administration console where it's reported the status of all my Tomcat instances and of MySQL. I don't need detailed information, ...
Hello
I would like to produce a list of dates based on a user determined "start date", over a 12 week period.
If a user selects today's date, I need to know each date from today over 12 weeks.
Once I have these dates, I would need to insert them into a DB table.
I'd like to say I've made some in-roads into how to do this, I reckon ...
Here is a simple php class for working with database. The problem with this class is in __destruct method, that launch mysql_close function.
If I create two DB objects that are situated in code very close it cause an error. It looks like that mysql_close close all database connections, not just his own($this->dbLink). Why it is happens?
...
Can someone shed some light on the differences between these 2 functions, from the PHP manual
addslashes:
Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash () and NUL (the NULL byte).
mysql_real_escape_string:
mysql_re...