T201704031307

This commit is contained in:
Leander
2017-04-03 13:07:43 +02:00
parent 555c14b279
commit 7827e582d5
4 changed files with 29 additions and 1 deletions

View File

@@ -35,6 +35,14 @@ class Question
$this->category = $c;
}
public static function get_next_question($db, $uid) {
$qid = $db->query('SELECT "Questions_ID" FROM "GamesQuestions" WHERE "Games_ID" = $1 LIMIT 1', array($uid))['data'][0]['ID'];
$question = new Question($db, $qid);
$db->query('DELETE FROM "GamesQuestions" WHERE "Games_ID" = $1 AND "Questions_ID" = $2', array($uid, $qid));
$question_object = $question->get_question_object();
return $question_object;
}
// Create the question message for API.
function get_question_object() {
$question_object = array(