Jump to content

Setting up a PHP script which will be run by a cron


Seaholme

Recommended Posts

Hey,

 

Pretty sure you guys are starting to get a bit sick of me asking questions here, but searching Google for answers to my problem, all I can find are tips for composing a cron yourself, and I'm 99% sure the cron isn't the problem.

 

Basically I've got hosting from GoDaddy.com which also gives you a Cron Manager -- you can enable/disable scripts, set exactly when and how often you want them to run and set which script you want to run directly from a "Browse Scripts" button, so on the basis that this is kinda foolproof, I'm sure that even I haven't got the setting up of the cron wrong xP

 

So all I can think is that my script is wrong. When I go to the script location in my browser, it works absolutely fine -- but my question is, is there anything specific I need to write into it which would make it work with the cron?

 

This is what the script consists of:

<?php
// Make a MySQL Connection
mysql_connect("xxx", "xxx", "xxx") or die(mysql_error());
mysql_select_db("xxx") or die(mysql_error());

mysql_query("UPDATE dogs SET age = age + 1");


?>

 

Should there be something in there to direct the Cron what to do?

 

Thanks for any help!

Make sure you have permissions set correctly on the cron job php file. Should be Executable by all, and hidden from the public root.

 

The command seems fine, and your script seems fine. I would contact support if the permissions dont do anything.

 

-cb-

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.