T201704031034

This commit is contained in:
Leander
2017-04-03 10:34:46 +02:00
parent 25f463c3e4
commit d800ef9481

View File

@@ -26,7 +26,7 @@
print_r(array($uid)); print_r(array($uid));
print_r($questions_count); print_r($questions_count);
if($uid = '') { if($uid == '') {
$error = 12103; $error = 12103;
} else if($length == 0) { } else if($length == 0) {
$error = 12101; $error = 12101;
@@ -39,7 +39,7 @@
$db->query('DELETE FROM "Games" WHERE "ID" = $1', array($uid)); $db->query('DELETE FROM "Games" WHERE "ID" = $1', array($uid));
} }
// Create new game for user. // Create new game for user.
$db->query('INSERT INTO "Games" ("ID") VALUES ($1)', $uid); $db->query('INSERT INTO "Games" ("ID") VALUES ($1)', array($uid));
// Find questions for new game and insert into table. // Find questions for new game and insert into table.
$questions = random_numbers(0, $questions_count-1, $length); $questions = random_numbers(0, $questions_count-1, $length);
foreach($questions as $question) { foreach($questions as $question) {