Mysql Correctly compare 2 datetimes?

n3tw0rkbu5t0r

New Member
I have an issue that i'm about to pull my hair out over, ok let me start.I'm using php and mysql i have a database that holds rows with information and one of the columns has a datetime field in a 24hr format.I am trying to retrieve information using the following query: \[code\]SELECT * FROM `table` where `new` != '1' AND `time` >= '2010-08-27 22:04:37' AND `name` LIKE '%apple%' OR `name2` LIKE '%apple%'\[/code\]My expectations of this query would be to retrieve everything from \[code\]table\[/code\] where \[code\]time\[/code\] is greater than or equal to 2010-08-27 22:04:37 . Which I thought would return everything from 2010-08-27 22:04:37 up 2010-08-28 etc. but i'm receiving rows with dates of \[code\]2010-08-26 04:59:342010-08-26 03:00:002010-08-26 23:00:00\[/code\]Could someone help me please. Thanks in advance!
 
Back
Top