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' -

java - Log4j2 configuration not found when running standalone application builded by shade plugin -

python - How do I create a list index that loops through integers in another list -