Closed maioradv closed 3 years ago
You may need to check the return object of query()
(null or PDOStatement) before calling fetchAll()
.
$statement = $database->query('QUERY');
if ($statement) {
$data = $statmenet->fetchAll(\PDO::FETCH_ASSOC);
}
Since Medoo v2.0, it's using strict_types
for strictly type checking.
Information
Describe the Problem when u're using
$db->query('MYQUERY')->fetchAll(\PDO::FETCH_ASSOC);
if there's an error in the query the result of$db->query('MYQUERY')
will be null so i cant call the method in the 1.7.10 version there isnt this problemi could use a variable and check if there's an error or using exception, but it can be useful for silentmode have a behave like the older version