I'm creating script which would sum number which is in database and the varriable - $currentPercent
. But i can't find any topic where it explains how to do that. Here is my script part which only updates the existing value... So i ask again, how could i sum existing value and the $currentTasken
varriable?
$inss = mysql_query("UPDATE dotp_tasks SET task_percent_complete = '$currentPercent' WHERE task_id='$currentTasken'") ;
UPDATED: For example $currentPercent
is number 8. And the number in database is 82. And then sum it 90.
答案 0 :(得分:2)
Hope this solves your problem:
$inss = mysql_query("UPDATE dotp_tasks
SET task_percent_complete = task_percent_complete + '$currentPercent'
WHERE task_id='$currentTasken'") ;
But personally, I would suggest you to search more before asking these kind of questions
答案 1 :(得分:0)