[thelist] [mysql] + operator

Paul Bennett paul at teltest.com
Sun Feb 2 18:33:05 CST 2003


ok, I have a numeric field in a database and I want to update it with
another numeric value, so the new data represents the total of the old
plus the new:
$sql = "update $tableName set hours=hours+'$newValue' where id='$id'
limit 1";
this is currently not working - the query executes fine, but the row is
not updated. I am guessing it is something to do with my syntax, as I am
unfamiliar with addition operation within a mysql query.
?

--
Paul Bennett
Internet Developer
Teltest Electronic Design
--------------------------
Phone : 64 4 237 0767
Web : http://www.teltest.com
Wap : http://wap.teltest.com
Email : paul at teltest.com
--------------------------





More information about the thelist mailing list