Yes, the query works for me too. But I'm attempting to do it with php, and placing the 8.50, or any dollar value, inside a variable. Since the $amount changes per product. That's where I'm getting caught up.
Here's what I've attempted:
With single quotes around $amount
$amount = 1.25;
$sql = "UPDATE sum_table SET total = total+'$amount' WHERE ID = 5";
mysql_query($sql,$connection) or die(mysql_error());
With no quotes around $amount
$amount = 1.25;
$sql = "UPDATE sum_table SET total = total+$amount WHERE ID = 5";
mysql_query($sql,$connection) or die(mysql_error());
Separating $amount from the query, slightly.
$amount = 1.25;
$sql = "UPDATE sum_table SET total = total+".$amount." WHERE ID = 5";
mysql_query($sql,$connection) or die(mysql_error());
Not quite sure what's left to try. But here's the error I keep getting back:
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 '+1.25 WHERE ID = 5 at line 1