$db->fetchAll("SELECT * FROM users WHERE ip = ?", ['192.168.1.1']);
public function fetchAll($sql, $params = []) { $stmt = $this->prepare($sql, $params); $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); $this->ok(); return $result; }
/** * fetchAll */ public function testFetchAll() { $result = $this->db->fetchAll("SELECT * FROM test LIMIT 10"); $this->assertEquals(10, sizeof($result)); }