I am trying to implement a Admin Level/User role into my website, I am fairly new to PHP so still trying to figure a few things out.
I have this SQL query:
$sqlUserLevel = $user_home->runQuery("SELECT * FROM po_users");
$sqlUserLevel->execute();
$loggedInUserRole = $sqlUserLevel->fetch(PDO::FETCH_ASSOC);
and this PHP if statement:
if($loggedInUserRole['userRole'] == "Admin"){
include 'file.php';
}else{
//dont show.
}
But the content is still showing to everyone not just "Admin" users can someone point me in the right direction...
$sqlUserLevel = $user_home->runQuery("SELECT * FROM po_users WHERE user_id = $currentUserID");