Re: Autodeleting news when it has become yesterdays news

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux