You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
713 B

<?php
//require_once ('Question.php');
class QuestionsGateway {
private $db;
function __construct(SqliteDb $db) {
$this->db=$db;
}
public function afficherQuestions() {
$i = 0;
$query = 'SELECT numquestion,question,reponse FROM Correct UNION SELECT numquestion,question,reponse FROM FunctionCorrect';
$query = $this->db->prepare($query);
$result = $query->execute();
//$resultats = $this->db->query('SELECT found_rows()');
while($q = $result->fetchArray()){
$i= $i+1;
$tabQuestions[] = new Question($q['numquestion'],$q['question'],$q['reponse']);
}
return $tabQuestions;
}
}