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
https://forums.phpfreaks.com/topic/79503-php-countdown/#findComment-402611
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
https://forums.phpfreaks.com/topic/79503-php-countdown/#findComment-402614
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
https://forums.phpfreaks.com/topic/79503-php-countdown/#findComment-402733
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.