06-10-2009, 07:18 PM
|
#4 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
Quote:
Originally Posted by DizzyD
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:
2009-06-09 20:54:13
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
Code:
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.
|
|
|
|