mrpatrick Posted November 15, 2007 Share Posted November 15, 2007 Im building a site to list concerts and events in an area. there are three states for an event, upcoming, happening today, or you missed it when the user submits the upcoming show, they insert the date of the show. when its the day of the show, i need that status entry to automatically update to "happening today" or the second state, and then the next day self update to the final state. i figure ill have to use cron to do this, or is there a way to run a script at the beginning of each day that will manage this? Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 15, 2007 Share Posted November 15, 2007 i dont think you need the self update all you need it to compare the given date to the date today i think datediff() is all you need datediff(givendate, now()) now if the result is greater than one then its upcoming if ==1 happening else you missed it Quote Link to comment Share on other sites More sharing options...
Barand Posted November 15, 2007 Share Posted November 15, 2007 Basically, you don't need to store the status at all. You just derive it as required as teng described, compare the event date with the current date. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.