Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    189
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Problem with cron

    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:

    PHP Code:

    $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:

    PHP Code:
    /var/www/vhosts/playsovereignty.com/httpdocs/strat/updatething.phpline 1: ?
    No such file or directory
    /var/www/vhosts/playsovereignty.com/httpdocs/strat/updatething.phpline 2:
    command not found
    /var/www/vhosts/playsovereignty.com/httpdocs/strat/updatething.phpline 3syntax 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

  • #2
    Banned
    Join Date
    Feb 2008
    Location
    Winnipeg, Canada
    Posts
    396
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Seems like there's other problems but you should change

    PHP Code:
    $result mysql_query("UPDATE userinf SET land=land+'1' WHERE username='King2k5' "$db); 
    To

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

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    What is the full path to the file, and what command did you use for cron to execute?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •