From 63a67194ca3628469cf2ee5e31c0bba58d13e1ba Mon Sep 17 00:00:00 2001 From: Leander Date: Mon, 10 Apr 2017 11:14:19 +0200 Subject: [PATCH] T201704101114 --- answer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/answer.php b/answer.php index 07fe553..21d8a87 100644 --- a/answer.php +++ b/answer.php @@ -37,6 +37,10 @@ if($uid == '') { $error = 13104; } else { //set time and points + $old_q_count = $db->query('SELECT "answered_questions" FROM "Games" WHERE "ID" = $1', + array($uid))['data'][0]['answered_questions']; + $new_q_count = $old_q_count + 1; + $db->query('UPDATE "Games" SET "answered_questions" = $1 WHERE "ID" = $2', array($new_q_count, $uid)); $old_points = $db->query('SELECT "current_score" FROM "Games" WHERE "ID" = $1', array($uid)) ['data'][0]['current_score']; $new_points = $old_points + $score;