Jump to content

PHP Countdown


Lukela

Recommended Posts

It depends on how accurate the 45 days has to be.  There's a number of approaches.

 

1.  Have a cron job run every minute (or 5 minutes, 10 minutes, 1 hour, depending on your accuracy requirement) that deletes old entries

2.  Have your scripts simply ignore any entry older than 45 days.

3.  Have your scripts check each time they run and clear any old entries.

Link to comment
Share on other sites

well php can't be a continuous function, we can only activate it from time to time, the trick to avert this problem is to run your query for results that are only greater than 45 days old.  Then above this use cron to run a script everyday to delete all invalid records (older than 45 days)

 

Don't over abuse cron make it 1 time a day at most

Link to comment
Share on other sites

20 minutes is fine.  The frequency with which a cron job runs should be inversely proportional to the work it does.

 

For example, a cron job that does 1 hour of heavy processing should usually be run no more than once per day.  But a job that does 1 second of processing can be run every 5 minutes without any adverse effects.

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.