0

I'm doing a simple auctioning site for a school project and I want to display a countdown for how long the auction will be active, starting from when its made and counting down a week or so (not set yet). I was thinking of when creating the auction, info is added into a database (what object, price, name, and time remaining). I would add what date and time the object is created and exactly 7 days after its no longer active. If I have time and date in my mySQL database, how would I display with php (or maybe AJAX? Never used it) the time remaining?

Any input is helpful as I'm completely stumped.

Simon Carlson
  • 1,919
  • 5
  • 24
  • 35
  • See http://stackoverflow.com/questions/1735252/php-countdown-to-date – Mihai8 Feb 28 '13 at 00:16
  • Seems to be time to start learning :). When you have some code ready, and encounter some problems you cannot solve, we will be happy to help you through those parts. – kapa Feb 28 '13 at 00:16
  • Nothing so far since I don't know how to approach this. I just need some basic ideas to get it started – Simon Carlson Feb 28 '13 at 00:16

1 Answers1

1

When you browse/display the auction just fetch the expiration date/time and then use JavaScript to countdown -- you do not need to call the database for it.

check this out: http://www.hashemian.com/tools/javascript-countdown.htm

Andrew
  • 7,619
  • 13
  • 63
  • 117
  • Please note that the example code given at that site shows terrible Javascript practices. – kapa Feb 28 '13 at 00:56