T1703271557

This commit is contained in:
Leander
2017-03-27 15:58:06 +02:00
parent 7099d41b2f
commit 8901180d85
3 changed files with 8 additions and 5 deletions

View File

@@ -14,9 +14,11 @@
$length = ($_GET['length'] && gettype(+$_GET['length']) == 'integer') ? +$_GET['length'] : 10;
$database = new Database();
$questions_count = $database->query('SELECT COUNT(*) FROM "Questions"')['data'][0]['count'];
if($length > $questions_count) {
if($length = 0) {
$error = 12101;
}
if($length > $questions_count) {
$error = 12102;
$values = array($questions_count);
}
$response = Database::create_response($data, $error, $values);