FD_F Posted August 28, 2009 Share Posted August 28, 2009 i have db in this structure : P_id , rdate P_id auto increment rdate have values like 2009-07-30 20:53:50 i need make query to take only last 24 hours records can i do it with only query ? or i need use strtotime ? thanks Link to comment https://forums.phpfreaks.com/topic/172339-solved-get-records-from-last-24-hours/ Share on other sites More sharing options...
annihilate Posted August 28, 2009 Share Posted August 28, 2009 Take a look at subdate: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_subdate In your case, you could do the following and end the query with: WHERE rdate > SUBDATE(SYSDATE(), 1) Link to comment https://forums.phpfreaks.com/topic/172339-solved-get-records-from-last-24-hours/#findComment-908666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.