...

View Full Version : Problem with cron



king2k5
02-25-2008, 07:23 PM
Ugh.. i hate crons.. i dont understand why i can never get it right the first time.. I have a cron set up, and the php file looks like this:




$db = mysql_connect("localhost","---","---");
mysql_select_db("soverei_testround",$db);



$result = mysql_query("UPDATE userinf SET land=land+'1' WHERE username='King2k5' ", $db);



Thats all thats in the file because i just want to test it out first...

i have it set to occur every minute, to make for faster testing, and it does trigger every minute, but its not working. I get this in the email from cron:


/var/www/vhosts/playsovereignty.com/httpdocs/strat/updatething.php: line 1: ?
: No such file or directory
/var/www/vhosts/playsovereignty.com/httpdocs/strat/updatething.php: line 2:
: command not found
/var/www/vhosts/playsovereignty.com/httpdocs/strat/updatething.php: line 3: syntax error near unexpected token `('
/var/www/vhosts/playsovereignty.com/httpdocs/strat/updatething.php: line 3: `$db = mysql_connect("localhost","---","---");
'

What could be wrong? any pointers would be great

Andrew Johnson
02-25-2008, 07:51 PM
Seems like there's other problems but you should change


$result = mysql_query("UPDATE userinf SET land=land+'1' WHERE username='King2k5' ", $db);

To


$result = mysql_query("UPDATE userinf SET land=land+1 WHERE username='King2k5' ", $db);

Inigoesdr
02-25-2008, 08:04 PM
What is the full path to the file, and what command did you use for cron to execute?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum