query() public method

A method to perform select query
public query ( string $query, integer | array $numRows = null ) : array
$query string Contains a user-provided select query.
$numRows integer | array Array to define SQL limit in format Array ($count, $offset)
return array Contains the returned rows from the query.
コード例 #1
0
ファイル: index.php プロジェクト: rittme/Voicela
 function GET()
 {
     $db = new MysqliDb($this->config["host"], $this->config["user"], $this->config["pass"], $this->config["base"]);
     $results = $db->query('SELECT * from film ORDER BY titre;');
     if (!empty($results) && count($results) > 0) {
         SimplestView::render("header");
         SimplestView::render('films', array("results" => $results));
         SimplestView::render("footer");
     }
 }