diff --git a/Question.php b/Question.php index 0447889..02e0501 100644 --- a/Question.php +++ b/Question.php @@ -36,7 +36,8 @@ class Question } 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']; + $qid = $db->query('SELECT "Questions_ID" FROM "GamesQuestions" WHERE "Games_ID" = $1 LIMIT 1', array($uid)) + ['data'][0]['Games_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(); diff --git a/register.php b/register.php index 3a90a26..8e7565e 100644 --- a/register.php +++ b/register.php @@ -14,12 +14,6 @@ $uid = md5(uniqid(rand(), true)); $db = new Database(); - - $det = $db->query('SELECT "question", "answer0", "answer1", "answer2", "answer3", "Categories_ID" - FROM "Questions" WHERE "ID" = 1')['data'][0]; - print_r($det); - - if(preg_match(PATTERN, $name) != 1) { $error = 11101; } else {