adambedford Posted February 10, 2010 Share Posted February 10, 2010 I've got a database with several fields including 'Renewal_date' and 'Visible'. When inserting records I calculate the renewal date based upon the current date and a couple of other things and I set 'Visible' to 'Y'. My queries throughout the site then filter out the records and display only those with 'Visible' set to 'Y'. I need a way to update the records each day so that any expired records then get visible set to 'N'. I'm thinking of using a crontab to execute the script once a day (at midnight perhaps) so that everything is as accurate as possible. My question is: how would I go about updating the records that have passed the 'Renewal_date'. I guess I need a checker of some sort to check whether they have expired or not and then MySQL to update the records? Would I need to use a foreach command or a do while? Thanks Link to comment https://forums.phpfreaks.com/topic/191629-updating-certain-records-at-the-start-of-the-day/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.