MYSQL query to get all entries with specific time, from PHP?

Posted by meds on Stack Overflow See other posts from Stack Overflow or by meds
Published on 2010-03-28T09:15:58Z Indexed on 2010/03/28 9:23 UTC
Read the original article Hit count: 340

Filed under:
|
|

I'm trying to query a mysql table which places its date in the following format: yyyy-mm-dd hh:mm:ss

So it's date and time, and that's all in a single field.

Now from php I want to get the time and query the table to only return entries where the date field is less than 24 hours old.

I'm having issues with the system because PHPs get time seems to return the values seperately and I'm struggling to figure out how to make it work with mysql queries.

This seems fairly simple but I'm quite new to php so sorry if I'm completely missing something..

© Stack Overflow or respective owner

Related posts about date

Related posts about mysql