What can I do so that a mySQL database automatically resets a certain field to 0 every week?

Hi, I have a site where each time you view a particular page (with a corresponding entry in the database), it adds 1 count to the fields weekplays and totalplays. How can I get it so that every week, it automatically resets weekplays to 0 for all the pages? By the way, the reason I have this field is to show the top grossing just for a single week, then reset. Thanks!

you need some form of "chron job" or script to run once a week that will perform those actions. I can’t name any, because I haven’t used them before, but try searching for use to program a chron job :)

One Response to “What can I do so that a mySQL database automatically resets a certain field to 0 every week?”

  1. you need some form of "chron job" or script to run once a week that will perform those actions. I can’t name any, because I haven’t used them before, but try searching for use to program a chron job :)
    References :

Leave a Reply