Need a PHP Clock based on mysql datetime

Discussion in 'PHP' started by ositcom, Aug 30, 2012.

  1. #1
    Hello,
    I have been stuck in this issue for 3 days now, I have datetime records in a mysql table, I need a php clock which naturally counts down, I mean acts like a clock, but the clock time should be the datetime field value descending by the second, based on the full datetime, from year to seconds
    It is not just one record, I made it to display this clock, the problem is javascript, which makes all the 36 records the last record value, it is an ajax pagination, so i will need to do the same on second page, right now ajax is not a prioritty, I can let go of ajax pagination, but need to display the clock
    Help is appreciated
    Many Thanks
     
    ositcom, Aug 30, 2012 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,899
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Mysql is the database and the user doesn't see it
    PHP runs on the server and the user doesn't see it

    so to have a clock counting down you'll need javascript of some sort

    Lets say you are counting down to the release of a new movie

    The database would hold the release date and time.

    The user requests a page, PHP builds the page and gives it the date and time from the database

    Javascript (and not necessarily ajax) will then give a countdown of time until the movie comes out

    If the user then requests another page it too will get built with the date/time from the database and javascript will resume the countdown

    does that help?
     
    sarahk, Aug 31, 2012 IP