rl
01-14-2004, 12:32 PM
I have a test script here, to try and get a cron job running
function db_connect($database)
{
mysql_connect("localhost","root","password");
mysql_select_db($database);
}
db_connect("database_name");
mysql_query("INSERT INTO stuff (id) VALUES ('1')");
The script works fine, I loaded it directly and it updates the database. However I want a cron job to execute the script.....
I have tried these alternatives, to update at whatever minutes are a few minutes ahead of me trying them ;)
30,31,32,33 * * * * /ftp/usr/lib/php /var/www/html/global_functions.htm 2>&1 > /dev/null
30,31,32,33 * * * * /ftp/usr/lib/php /var/www/html/global_functions.htm
30,31,32,33 * * * * /var/www/html/global_functions.htm 2>&1 > /dev/null
However, none of them updated the table. Has anyone else here used a cron successfully? I'd appreciate some pointers.
Thanks.
function db_connect($database)
{
mysql_connect("localhost","root","password");
mysql_select_db($database);
}
db_connect("database_name");
mysql_query("INSERT INTO stuff (id) VALUES ('1')");
The script works fine, I loaded it directly and it updates the database. However I want a cron job to execute the script.....
I have tried these alternatives, to update at whatever minutes are a few minutes ahead of me trying them ;)
30,31,32,33 * * * * /ftp/usr/lib/php /var/www/html/global_functions.htm 2>&1 > /dev/null
30,31,32,33 * * * * /ftp/usr/lib/php /var/www/html/global_functions.htm
30,31,32,33 * * * * /var/www/html/global_functions.htm 2>&1 > /dev/null
However, none of them updated the table. Has anyone else here used a cron successfully? I'd appreciate some pointers.
Thanks.