timer based mysql database update
Moderator: General Moderators
timer based mysql database update
how can i update a mysql database, using php code, or any other program to run in background on server, based on timing. i mean... every 20 minutes to dun the command : UPDATE TABLE SET FIELD = FIELD + X . please help if you know ...
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
i'd say to write the script in the language you know best.
and then make sure cron runs that script every x minutes.
for example 0 * * * * /usr/bin/wget http://localhost/script.php
and then make sure cron runs that script every x minutes.
for example 0 * * * * /usr/bin/wget http://localhost/script.php
I didn't like running wget because it skewed results of web site access. My host would appear far too often in the logs. So i use this in my cron jobs:
Doug
Code: Select all
0 * * * * php /home/path/to/wherever/code.php > /dev/null