0
I’m studying creation of Crud with Php and Bootstrap, and when the file menu_admin and opened in the browser it gives this error:
Warning : Invalid argument supplied for foreach() in C: xampp htdocs crud menu_admin.php on line 44
Link to github, who can help me thank you very much !!!
https://github.com/rockout13/crud
I changed what they said, but another problem appeared, it would be the query that is failing ?
Fatal error : Uncaught Error: Call to a member function fetchAll() on boolean in C:\xampp\htdocs\crud\menu_admin.php:45 Stack trace: #0 {main} thrown in C:\xampp\htdocs\crud\menu_admin.php on line 45
Just put "->" in the foreach($Pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC) as $Row){
– Wilson Faustino
Vlw, I ended up mixing other languages kkk
– Roberto de Campos
Edited response
– Roberto de Campos
i changed what they said, but another problem appeared, is the query that is failing ?
Fatal error
: Uncaught Error: Call to a member function fetchAll() on boolean in C:\xampp\htdocs\crud\menu_admin.php:45 Stack trace: #0 {main} thrown in
C:\xampp\htdocs\crud\menu_admin.php
on line
45
– Renan Ramos
Probably because when the
query
of error returnfalse
, asfalse
is the typeboolean
, does not have the functionfetchAll
. Try to run thequery
direct at the bank.– Roberto de Campos