I'm working on a website with PHP and I have an error in my code that I don't know how to solve.
The error is :
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp64\www\npanel\reload_userlist.php on line 13
And my code is :
$selectionuser = $db->query("SELECT * FROM `users\`");
// Print Output
foreach($selectionuser as $AfficheUser)
{
if($_SESSION["id"] == "1"){
$buttondelete = "<a href='assets/suser.php?id=" . htmlspecialchars($AfficheUser['id']) . "' class='sidebar-link btn btn-danger'><span class='hide-menu'>Delete</span></a>";
}
Can someone help me ? Thanks ! ^^
I'm Using a MySQL database
The goal is to get an userlist of people registered on my website. here in my webpage