Re: PHP 24 hour processes?

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

 



Daniel Brown wrote:
On Mon, Feb 25, 2008 at 1:39 AM, Zoran Bogdanov <test1.test1@xxxxxxxxxxx> wrote:
Hi,

 How can you perform a timed event in PHP; for example:

 Count 24 hours and then delete all rows in a database...

    Once again, I say verily unto you: RTFM and STFW.

    Linux/*nix:  cron
    Windows:   at

Cron Example:
40 03 * * * `which php` /path/to/php/script.php

PHP:
<?
include('configure.php'); // With database connection stuff, et cetera.
$sql = "TRUNCATE TABLE `table_name`";
mysql_query($sql);
?>


of negate php all together and use cron to schedule:

mysql -h hostname -u username -ppassword -e "TRUNCATE TABLE `table_name`"

--
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