Files
post-grachelor-web/start.php
2017-03-27 15:58:06 +02:00

26 lines
697 B
PHP

<?php
/**
* Created by PhpStorm.
* User: leanderschmedemann
* Date: 27/03/2017
* Time: 14:07
*/
require_once('includes.inc.php');
$data = '';
$error = 0;
$values = null;
$uid = $_GET['uid'];
$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 = 0) {
$error = 12101;
}
if($length > $questions_count) {
$error = 12102;
$values = array($questions_count);
}
$response = Database::create_response($data, $error, $values);
print $response;
?>