在SQL / PHP中添加到MAMP数据库

时间:2015-06-08 13:04:57

标签: php mysql mamp

我制作了一个程序,从数据库中提取问题,供人们回答 当他们正确回答时,弹出下一个问题按钮 它还需要将该用户的得分提高1,我该怎么告诉它呢?

The database

if($answer === $dbanswer) {
        echo "correct! (creates button that goes to Next Question)

   //This is the part I want working.   

   UPDATE users   
   SET score = score + 1    
   WHERE id = this user's id

} else
   echo "incorrect, try again ";

0 个答案:

没有答案