php - How do I UPDATE a value in a DB and add another value to it -


what wish update value stored in db same value + value.

example:

$points=$_post['points'];   $ptsupdt = "update kids set points = points + '$points' name='$name'"; 

currently when run statement, adds double value stored in $points.

example: if $points=5 updated value original value + 10.

just don't quote $points!

$ptsupdt = "update kids set points = points + $points name = '$name'";


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -