TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   PHP Timer (http://www.talkphp.com/advanced-php-programming/4945-php-timer.html)

russellharrower 09-13-2009 01:25 PM

PHP Timer
 
Hi I need away to do the following

Say I have a song that is 3:00 <-Minutes
and it was placed in the DB at 12:45
and the time is now 2:50
I need it to tell me if the song has finished or how many minutes/seconds are left.

If any one can help that would be so kind.

adamdecaf 09-13-2009 03:02 PM

Store the start time in a cookie or a database (and give the user an ID to match against). Then just compare the time.

russellharrower 09-13-2009 03:04 PM

Sadly that will not work, Due to it is all in the database, and as we are allow users to search and find Now playing information from radio stations that would mean a lot of cookies I think.

Thoughts?

Randy 09-13-2009 06:24 PM

create a section on the database called 'users' or something like that then do something like this.

take the users ip store it in the database with the time. then have like an end time accessed at some point. then to find how many minutes are left do like "$end - $start" and store data in your database via IP

russellharrower 09-14-2009 03:57 PM

Thank you.


All times are GMT. The time now is 06:39 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0