View Single Post
06-10-2009, 07:18 PM
Join Date: Sep 2007
Originally Posted by
Thanks for the quick response. The database is set to automatically set the time/date when the entry is made (CURRENT_TIMESTAMP). So the format is set like so:
So yes I pull it as a string,
$row['time'] displays "2009-06-09 20:54:13"
So i need to get the current time in that same format I would assume, then find the difference of the 2. If it's 8 or more, perform action.
What data type is it? I would assume timestamp if that is the default value. If that is corrent, that means that you are getting the a formatted timestamp opposed to a string. Have a query something like this
SELECT * FROM db WHERE DATESUB(CURDATE(),INTERVAL 8 HOURS)>=insert_time
Anything that query returns will be more than eight hours old. insert_time being the column name of your timestamp. This code is not tested, but should work.
The Following User Says Thank You to Village Idiot For This Useful Post:
View Public Profile
Send a private message to Village Idiot
Find More Posts by Village Idiot