Random Record from DB every day
Posted: Thu Jun 29, 2006 9:51 am
Hey guys. I have a section on my website that has a "Today's Featured Car" spot where everyday I update it to feature a random car in my database. I want to make this 'automatic' and write a php snippet to randomly select one of the car records each day and display that one random car for 24 hrs.
I know how to write it so it can randomly select a record from the database, but the problem is it selects a random record on every page reload. How can I go about having it automatically select a record each day and use that same record throughout the entire 24 hrs. Thanks for any advice and help!
I know how to write it so it can randomly select a record from the database, but the problem is it selects a random record on every page reload. How can I go about having it automatically select a record each day and use that same record throughout the entire 24 hrs. Thanks for any advice and help!