Im trying to recall the logged in user's userlevel from mysql for the if function that determines whether to show the admin panel or not. if anyone can help me and tell me what i was missing so i can learn from this experience, that would be great!
here is my code... it's not working :(
$loginLink = '<a class="load" href="login.php">Log In</a> | <a class="load" href="signup.php">Sign Up</a>';
if($user_ok == true) {
$query = mysqli_query($db_conx, $sql);
$row = mysqli_fetch_row($query);
$sql = "SELECT id FROM notifications WHERE username='$log_username' AND date_time > '$notescheck' LIMIT 1";
$query = mysqli_query($db_conx, $sql);
$userlevel = "SELECT userlevel FROM users WHERE username='$log_username' LIMIT 1";
if ($userlevel == 'admin' && $userlevel == 'owner') {
$adminPanel = '<a class="load" href="adminpanel.php">Admin Panel</a>';
}else {
$adminPanel = ' ';
}
?>