T201704032327
This commit is contained in:
10
start.php
10
start.php
@@ -24,11 +24,11 @@
|
||||
}
|
||||
|
||||
if($uid == '') {
|
||||
$error = 12103;
|
||||
} else if($length == 0) {
|
||||
$error = 12101;
|
||||
} else if($length > $questions_count) {
|
||||
} else if($length == 0) {
|
||||
$error = 12102;
|
||||
} else if($length > $questions_count) {
|
||||
$error = 12103;
|
||||
$values = array($questions_count);
|
||||
} else {
|
||||
// Delete existing game for user.
|
||||
@@ -37,7 +37,9 @@
|
||||
}
|
||||
// Create new game for user.
|
||||
$db->query('INSERT INTO "Games" ("ID") VALUES ($1)', array($uid));
|
||||
print_r(pg_last_error());
|
||||
if(preg_match('/violates foreign key constraint "Games_ID_fkey"/', pg_last_error()) == 1) {
|
||||
$error = 12104;
|
||||
}
|
||||
// Find questions for new game and insert into table.
|
||||
$questions = random_numbers(0, $questions_count-1, $length);
|
||||
foreach($questions as $question) {
|
||||
|
||||
Reference in New Issue
Block a user