query() 공개 메소드

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)
리턴 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");
     }
 }