Jump to content

date based data changes?


mrpatrick

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.