TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-10-2009, 06:49 PM   #1 (permalink)
The Wanderer
 
DizzyD's Avatar
 
Join Date: Feb 2009
Posts: 11
Thanks: 1
DizzyD is on a distinguished road
Default 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
DizzyD is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
Tutorial for Beginners - Not a usual tutorial [Read it all and i think it will help] codefreek Absolute Beginners 8 01-26-2009 03:14 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
$36,000 - Full Time PHP Coder / Designer Position Rex The Lounge 10 01-18-2008 08:32 PM
Calculating the Execution Time Wildhoney Tips & Tricks 0 09-14-2007 11:14 PM


All times are GMT. The time now is 10:44 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design