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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -