php - Update query fails almost 1 in 10 times -


i've got query:

$wd=1.5480; $query = "update books set myprice= myprice + $wd";   

the query fails 1 in 10 times. there no obvious pattern can spot.
column try update float. value varies 0 9.99999.
i've set error log report the error in query, , display query itself.
i've got error in error log:

database error: have error in sql syntax; check manual  corresponds mysql server version right syntax use near '=+1'  @ line 1<br/><br/> query:update books set =+1 

as can see myprice missing query. doing wrong?

thanks in advance help.

try this:

$query = "update books set `myprice` = `myprice`+".$wd; 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -