06-10-2009, 06:49 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: Feb 2009
Posts: 11
Thanks: 1
|
php time?
So I have a video id and at timestamp stored in a database. I'm created a cron.php to pull the data in a while() loop and compare the time w/ the current time. If it's been 8hrs or more, then the row is to be deleted, if not, then nothing happens. In theory it makes sense, but i'm unsure how to achieve the time math. Here what I'm working with so far:
Code:
$sql = "SELECT * FROM credits_temp";
$query = mysql_query($sql);
while ($row = mysql_fetch_array($query)) {
//Database time
$dataBaseTime = $row['time'];
$curTime = '2009-06-09 20:54:13';//not sure how to use date for this time format...
$difference = "i have no idea"
if( $difference >= "8hrs somehow")
{
//delete the row
}
}
Any help or guidance would be most helpful. Thanks :D
Dave
|
|
|
|