bachx Posted May 3, 2007 Share Posted May 3, 2007 I want a certain field in my SQL database to be automatically updated at a certain time interval (say every 1 hour) without having to run the php script. Is such a thing possible? If so how? Thanks Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/ Share on other sites More sharing options...
papaface Posted May 3, 2007 Share Posted May 3, 2007 make a php script to do it, and then set up a cron job for 1 hour intervals. Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/#findComment-244615 Share on other sites More sharing options...
bachx Posted May 3, 2007 Author Share Posted May 3, 2007 What's a cron job? Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/#findComment-244618 Share on other sites More sharing options...
bachx Posted May 3, 2007 Author Share Posted May 3, 2007 Help...anyone? Need this urgently. Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/#findComment-244699 Share on other sites More sharing options...
corbin Posted May 3, 2007 Share Posted May 3, 2007 If it's a unix server, try googling CRON (sorry, I'm not very unix savvy). If it's windows, try making a scheduled task to make it request the php script every X minutes or what ever. (Google it if you don't know how to do that). Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/#findComment-244704 Share on other sites More sharing options...
bachx Posted May 3, 2007 Author Share Posted May 3, 2007 Ok, i've created a new cron job in cpanel. What is the command i should use to run a php script file? I've tried putting the file path as the command but that didn't work. Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/#findComment-244717 Share on other sites More sharing options...
jchemie Posted May 3, 2007 Share Posted May 3, 2007 the format for cron is in general path/to/php/interpreter -q /path/to/page eg. /usr/bin/php -q /home/organicc/public_html/reports/report.php Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/#findComment-244725 Share on other sites More sharing options...
bachx Posted May 3, 2007 Author Share Posted May 3, 2007 Thanks alot, that worked. I had the path wrong. Link to comment https://forums.phpfreaks.com/topic/49862-automatically-updating-the-db-at-a-predefined-time-interval/#findComment-244736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.