fetchAll() public method

Example of usage $db->fetchAll("SELECT * FROM users WHERE ip = ?", ['192.168.1.1']);
public fetchAll ( string $sql, array $params = [] ) : array[]
$sql string SQL query with placeholders "SELECT * FROM users WHERE ip = :ip"
$params array params for query placeholders (optional) array (':ip' => '127.0.0.1')
return array[]
Exemplo n.º 1
0
 /**
  * fetchAll
  */
 public function testFetchAll()
 {
     $result = $this->db->fetchAll("SELECT * FROM test LIMIT 10");
     $this->assertEquals(10, sizeof($result));
 }