tags:

views:

30

answers:

2

Using php i want to make the following mysql query

SELECT * FROM TABLE WHERE AUTODATE > (24HRS DIFFERENCE FROM CURRENT DATE)

the AUTODATE var CURRENT_TIMESTAMP has values in format Y-m-d H:i:s

How is that possible?

+1  A: 

You might want

SELECT ... WHERE yourDateField > Curdate() - Interval 1 day
or maybe
SELECT ... WHERE yourDateField > Now() - Interval 24 hour

VolkerK
+1  A: 
WHERE DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= autodate;

read the manual.

erenon
thanks for the answer :)