Continuous Script

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
cooldude_i06
Forum Newbie
Posts: 2
Joined: Thu Aug 26, 2004 7:43 pm

Continuous Script

Post by cooldude_i06 »

Hi, I'm new to the forums and SQL, but i have been able to setup a simple mysql database. I'm looking for a script that can run continuously in the background and perform some necessary calculations every few minutes. I know some php but im not sure if php can be executed non-stop, without having to go to a url. The database is on a web server and not my computer. Thanks in advance.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Sounds like you want a cron job
cooldude_i06
Forum Newbie
Posts: 2
Joined: Thu Aug 26, 2004 7:43 pm

Post by cooldude_i06 »

markl999 wrote:Sounds like you want a cron job
ok my webserver supports cron jobs, and i think the best way to accomplish my task would be to create a php script and have cron execute it ....right??
if this is true can u also help me with the command of executing a php script, thanks again.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

ok my webserver supports cron jobs, and i think the best way to accomplish my task would be to create a php script and have cron execute it ....right??
Right.
if this is true can u also help me with the command of executing a php script, thanks again.
2 ways really. Either run the script in cron like '/usr/bin/php -q thescript.php' or put #!/usr/bin/php at the top (before the <?php tag) of your script and run just thescript.php from cron.
Post Reply