Jump to content

MySQL Query Problem - Update trouble at 'WHERE' claus


MasterACE14

Recommended Posts

Evening PHP Freaks,

 

I am having some trouble with my MySQL Query, it has been working fine, but when I had to add something new to the WHERE part of the query, it is now spitting out errors. any help is greatly appreciated!  :)

 

query:

<?php

$sqlzx = "UPDATE `cf_users`,`cf_users2` SET `cf_users`.`money`= `cf_users`.`money`+ `cf_users2`.`amount_supplydrop`*`cf_users2`.`amount_supplysize` WHERE cf_users.id = cf_users2.id , `cf_users`.`current_health` > 0";

// execute the query
$rs = mysql_query( $sqlzx ) or die('Query:<br />' . $sqlzx . '<br /><br />Error:<br />' . mysql_error());

?>

 

The trouble part is where I have `current_health`

 

here's the output I'm getting:

Query:

UPDATE `cf_users`,`cf_users2` SET `cf_users`.`money`= `cf_users`.`money`+ `cf_users2`.`amount_supplydrop`*`cf_users2`.`amount_supplysize` WHERE cf_users.id = cf_users2.id , `cf_users`.`current_health` > 0

 

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 ' `cf_users`.`current_health` > 0' at line 1

 

Regards ACE

Archived

This topic is now archived and is closed to further replies.

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