i have this query:
$key = "particle";
$value = 6
$sql =
"
UPDATE `B5CGM`.`tac_adaptivearmour`
SET `".$key."points` = '".$key."points' + $value
WHERE"." gameid = $gameid AND shipid = $damage->shipid
";
which after debugging results in this string:
UPDATE `B5CGM`.`tac_adaptivearmour` SET `particlepoints` = 'particlepoints' + 6 WHERE gameid = 2703 AND shipid = 16624
Basicly, what i want is for my query to take the current value of particlepoints in the DB, and increase it by a certain amount which i set via a variable into the UPDATE string.
Before the query, particlepoints is 6 in the DB. After running above query, i would except the table to hold the value 12 as particlepoints. Instead, its set to 6 - i.e. either it remains as 6, or it is set to 6 without taking the original value into account.
thanks.