Re: Autodeleting news when it has become yesterdays news
| From: | David Grant | Date: | Wed, 23 Nov 2005 14:06:31 +0000 |
| Subject: | Re: Autodeleting news when it has become yesterdays news | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-226352@lists.php.net to get a copy of this message | ||
twistednetadmin wrote:
> Just at the beginning of the page with the news is my thought. So that it
> checks for the eventdate and erases the overdued ones before it collects the
> news.
If you wanted to do that, I'd recommend adding some sort of probability
factor into it, so not all scripts have to run the function.
e.g. 1% chance of cleaning up the database.
<?php
if (rand(1,100) > 99) {
deleteItems();
}
?>
Cheers,
David Grant