Nevulus Posted July 21, 2007 Share Posted July 21, 2007 Disclaimor: I'm sorry in advance if this is posted somewhere else, I've searched and had very limited success. Yes, I'm a newb Problem: I am trying to create a timed event: Every hour I would like a script that will run a MySQL query (insert data into a table). Ive tried some loops which came up with a timed out error (exceeded 30 sec rule). I currently have a third party clock code that will display an updating time clock using php/javascript to compare server time/user time and come to a happy median. I don't know if appending to this code might help, or if I am better of starting from scratch. It is quite simple, I just want to run my MySQL query every hour. Will a infinite loop use up too much server resources? Is it even possible to create an infinite loop in PHP? Have it check every so often if an hour has passed and then run my query. Any help is much appreciated. Thank you for your patience. Link to comment https://forums.phpfreaks.com/topic/61071-php-timed-event/ Share on other sites More sharing options...
cooldude832 Posted July 21, 2007 Share Posted July 21, 2007 if you on a Unix system CronTab will do it. Link to comment https://forums.phpfreaks.com/topic/61071-php-timed-event/#findComment-303919 Share on other sites More sharing options...
Nevulus Posted July 21, 2007 Author Share Posted July 21, 2007 I was hoping for a solution based on a php or php/javascript. So it can contain the ease of stopping and starting at will by simply loading a page or pressing a button and checking the status easily from my pda. I will continue my search =] Link to comment https://forums.phpfreaks.com/topic/61071-php-timed-event/#findComment-303956 Share on other sites More sharing options...
Nevulus Posted July 21, 2007 Author Share Posted July 21, 2007 I think it will be too much of a hassle, especially if i try as an include to my index page, too much overhead produced by the script. I guess my only option is cron. Is there a difference from having php compiled as CGI or as an apache module? when configuring the php file for cron? Link to comment https://forums.phpfreaks.com/topic/61071-php-timed-event/#findComment-303971 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.