I have a value in my MYSQL database, all I want to do is to increase the current value with a new one, this is what I have tried
} elseif ($gametype == "veckanskluring"){
$sql = "UPDATE users SET veckanskluring='veckanskluring'+'$score' WHERE id='$id'";
$retval = mysql_query( $sql, $link );
echo "GAME == $gametype";
}
But for some odd reason, this won't work. I have searched online and found examples, but they all look, almost exactly the same as my code.
// Sidenote this is not the whole code, obviously. Everything except the part where I add the new value to the old value works, and if I remove 'veckanskluring'+ it updates without any problems. I strongly believe something is wrong with this part - 'veckanskluring'+ as the other part works fine. //NOTE2 score is always 999, just have it set to $score if I want to change it later.
UPDATE -
MY fault, apparently I had put '' around veckanskluring.
$sql = "UPDATE users SET veckanskluring=veckanskluring +'$score' WHERE id='$id'"; <-- Working.