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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.