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
608 B
24 lines
608 B
<?php
|
|
//require_once ('Question.php');
|
|
class QuestionsGateway {
|
|
private $db;
|
|
|
|
|
|
function __construct(SqliteDb $db) {
|
|
$this->db=$db;
|
|
}
|
|
|
|
public function afficherQuestions() {
|
|
$i = 0;
|
|
$query = 'SELECT * FROM Correct';
|
|
$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($i,$q['question'],$q['reponse']);
|
|
}
|
|
return $tabQuestions;
|
|
}
|
|
}
|