31 lines
602 B
PHP
31 lines
602 B
PHP
<?php define('__ROOT__', dirname(__DIR__));
|
|
|
|
require_once __ROOT__.'/autoloader.php';
|
|
|
|
debug();
|
|
|
|
use \database\core\DatabaseDriver;
|
|
use \database\core\Rows;
|
|
use \database\core\Table;
|
|
|
|
|
|
function getSubjects(){
|
|
// let's suppose idEtude
|
|
$etude = Table::get('sujets', 'lab-surveys')
|
|
->where('idEtude', 3);
|
|
|
|
/* (1) Fetch subjects of this etude */
|
|
$sujets = Table::get('sujets', 'lab-surveys')
|
|
->join('idEtude', $etude)
|
|
->select('idSujet', null, false, 'id')
|
|
->select('pseudo');
|
|
|
|
|
|
return sujets->fetchAll();
|
|
|
|
}
|
|
|
|
function getQuestions(){}
|
|
|
|
function getAnswers($id_subject){}
|