24 lines
646 B
PHP
24 lines
646 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 > $questions_count) {
|
|
$error = 12101;
|
|
$values = array($questions_count);
|
|
}
|
|
$response = Database::create_response($data, $error, $values);
|
|
print $response;
|
|
?>
|