dimanche 25 octobre 2020

Fatal error: Uncaught Error: Call to a member function fetchAll() on bool [duplicate]

Hello i made a small searchengine with a webcrawler. I use PDO for the Database. But if i changed this line:

$web = $connection->query("SELECT * FROM `sites`");

in this line:

$web = $connection->query("SELECT * FROM `sites` WHERE title LIKES `$search`");

I have this error:

**Fatal error: Uncaught Error: Call to a member function fetchAll() on bool in C:\xampp\htdocs\Lens-Application\LensGO\results.php:28 Stack trace: #0 C:\xampp\htdocs\Lens-Application\LensGO\results.php(42): getWeb() #1 {main} thrown in C:\xampp\htdocs\Lens-Application\LensGO\results.php on line 28

And this is line 28: print_r($web->fetchAll());**

Can anyone help me please?




Aucun commentaire:

Enregistrer un commentaire