Closed keldon2295 closed 6 years ago
Did you ever get an answer to this? I am having a similar problem in our project. Everything has been working for some time and suddenly I get the error:
Fatal error: Call to a member function fetchAll() on a non-object in *****
I also have similar problem..currently using medoo v 0.9. The error started when i upgraded mysql from 5.5 to 5.7. Please share if you guys have a solution.
It returns false if in debug mode - or if the query doesnt work -
https://github.com/catfan/Medoo/blob/master/src/Medoo.php#L279-L318
@y2k4ever , @keldon2295 . To fix, all you need to do is replace the above with the old version
My problem was with a query, in my case, there was a missing parameter. My actual problem was that I was hiding a section of content from myself and couldn't see what was really going on.
@cejayassoc You problem is a different problem than the problem addressed in this issue. I cannot figure out what you mean due to lack of information
The query()
will return false if preparation pdo->prepare()
is failed. https://github.com/catfan/Medoo/issues/588
You can check the statement before next operation.
$statement = $database->query("SELECT * FROM EVENTDB.domains d WHERE d.domain_id='7'");
if ($statement)
{
$data = $statement->fetchAll(PDO::FETCH_ASSOC);
}
Hello,
I was on version 0.9.6 and recently updated the file to the newest version. Upon doing so query's started to fail with the following error:
Fatal error: Call to a member function fetchAll() on boolean in
The query runs perfectly fine on the older version but fails on the newer versions. Any thoughts;
$data = $dbConn->query("SELECT * FROM EVENTDB.domains d WHERE d.domain_id='7')->fetchAll(PDO::FETCH_ASSOC);