Jump to content
MakeWebGames

Recommended Posts

Posted

For some reason, when my cron gives me this error. Which I do not know why it is not working.

 

QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' `strikes` = `strikes` + IF(`job` > 0, 1, 0), `mailban` = `mai' at line 5
Query was UPDATE `users` SET `daysinclan` = `daysinclan` + IF(`clan` > 0, 1, 0), `daysold` = `daysold` + 1, `course_daily_clicks` = 0, `wof_spins` = 0, `work` = 0, `claimedloginbonus` = 0, `boxes` = IF(`donatordays` > 0, `boxes` + 25, `boxes` + 10) WHERE `boxes` < 25, `strikes` = `strikes` + IF(`job` > 0, 1, 0), `mailban` = `mailban` - IF(`mailban` > 0, 1, 0), `donatordays` = `donatordays` - IF(`donatordays` > 0, 1, 0), `cdays` = `cdays` - IF(`course` > 0, 1, 0), `steps` = IF(`donatordays` > 0, `steps` + 100, `steps` + 50) WHERE `steps` < 250, `married_days` = IF(`married`, `married_days` + 1, 0), `bankmoney` = `bankmoney` + IF(`bankmoney` > 0, `bankmoney` / 50, 0), `cybermoney` = `cybermoney` + IF(`cybermoney` > 0, `cybermoney` / 100 * 7, 0)

 

 

$user_update_query =
       "UPDATE `users` SET 
        `daysinclan` = `daysinclan` + IF(`clan` > 0, 1, 0),
        `daysold` = `daysold` + 1, `course_daily_clicks` = 0,
        `wof_spins` = 0, `work` = 0, `claimedloginbonus` = 0,
        `boxes` = IF(`donatordays` > 0, `boxes` + 25, `boxes` + 10) WHERE `boxes` < 25,
        `strikes` = `strikes` + IF(`job` > 0, 1, 0),
        `mailban` = `mailban` - IF(`mailban` > 0, 1, 0),
        `donatordays` = `donatordays` - IF(`donatordays` > 0, 1, 0),
        `cdays` = `cdays` - IF(`course` > 0, 1, 0),
        `steps` = IF(`donatordays` > 0, `steps` + 100, `steps` + 50) WHERE `steps` < 250,
        `married_days` = IF(`married`, `married_days` + 1, 0),
        `bankmoney` = `bankmoney` + IF(`bankmoney` > 0, `bankmoney` / 50, 0),
        `cybermoney` = `cybermoney` + IF(`cybermoney` > 0, `cybermoney` / 100 * 7, 0)";
$db->query($user_update_query);

 

Posted (edited)

How come nobody here uses PDO? Does everyone realise that in just a few versions of PHP, MySQL functions are going to be removed from PHP all together? I have almost fully converted my game over. But anything new I make, I always use PDO.

Edit: dug into it a little further and found out they are removing it in PHP 7. However I found out that it will still be available as an add-on. (https://wiki.php.net/rfc/remove_deprecated_functionality_in_php7)

Edited by alexander7567
Posted

Also, to follow up [uSER=69869]alexander7567[/uSER], the mysql_ extension will be removed - the mysqli_ extension will still work just fine in PHP 7.

~G7470

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.   Paste as plain text instead

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