RE: [PHP-DB] MySQL, PHPand cron
| From: | Gurhan Ozen | Date: | Thu, 28 Mar 2002 19:58:59 +0000 |
| Subject: | RE: [PHP-DB] MySQL, PHPand cron | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18009@lists.php.net to get a copy of this message | ||
Hi Jenn,
There are a couple ways you can do this.
You can write a unix shell script and run it periodically at the cron.
Here:
#!/bin/mysql
query="DELETE FROM tablename"
/usr/bin/mysql -u USER -pPASSWORD -D database -e "$query"
And then you can just put this script into cron, see:
http://www.faqts.com/knowledge_base/view.phtml/aid/1005/fid/436
Or you can do the same in the PHP script and call PHP script in command
line.. See the below links for this:
http://www.php.net/manual/en/commandline.php
http://www.phpbuilder.com/columns/darrell20000319.php3
Gurhan
-----Original Message-----
From: Jennifer Downey [mailto:jendowney@attbi.com]
Sent: Thursday, March 28, 2002 2:32 PM
To: php-db@lists.php.net
Subject: [PHP-DB] MySQL, PHPand cron
Hi all,
Wondering if anyone might know how to empty a table with a php script and
cron job?
Would someone point me to a tutorial or help with this?
TIA
Jennifer
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php