T2017040812279

This commit is contained in:
Leander
2017-04-06 12:29:53 +02:00
parent f40a6e35b3
commit 58b9d9473d
3 changed files with 5 additions and 2 deletions

View File

@@ -13,7 +13,7 @@
12101 - User ID not specified 12101 - User ID not specified
12102 - 0 questions wanted, no game without a question! 12102 - 0 questions wanted, no game without a question!
12103 - More questions wanted then existing 12103 - More questions wanted then existing
12104 - User name not existing 12104 - User ID not existing
= answer.php = = answer.php =
13101 - User ID not specified 13101 - User ID not specified
@@ -27,3 +27,4 @@
= highscores.php = = highscores.php =
15101 - User ID not specified 15101 - User ID not specified
15102 - User ID not existing

View File

@@ -71,6 +71,7 @@ class Database
case 12103: case 12103:
return 'Sorry, we only have '.$values[0].' questions. Please try again.'; return 'Sorry, we only have '.$values[0].' questions. Please try again.';
case 12104: case 12104:
case 15102:
return 'The specified user name does not exist. This is an internal error.'; return 'The specified user name does not exist. This is an internal error.';
case 13102: case 13102:
return 'No valid time specified. This is an internal error.'; return 'No valid time specified. This is an internal error.';

View File

@@ -23,7 +23,8 @@ if($uid == '') {
$error = 15101; $error = 15101;
} else if($db->query('SELECT EXISTS (SELECT 1 FROM "Users" WHERE "ID" = $1)', array($uid)) } else if($db->query('SELECT EXISTS (SELECT 1 FROM "Users" WHERE "ID" = $1)', array($uid))
['data']['0']['exists'] == 'f') { ['data']['0']['exists'] == 'f') {
$error = 15102;
}
$score = $db->query('SELECT "highscore" FROM "Users" WHERE "ID" = $1', array($uid))['data'][0]['highscore']; $score = $db->query('SELECT "highscore" FROM "Users" WHERE "ID" = $1', array($uid))['data'][0]['highscore'];
$all = $db->query('SELECT COUNT (*) FROM "Users"')['data']['0']['count']; $all = $db->query('SELECT COUNT (*) FROM "Users"')['data']['0']['count'];
echo 'Score: '.$score; echo 'Score: '.$score;