Reaching out for a second pair of eyes.
I just don't get what the issue is here, I've been using the same format throughout out my whole site until now I get this error:
<?php
session_start();
include"lib/config.php";
$logged_user = $_SESSION['username'];
$check_admin = "SELECT * FROM `members` WHERE `is_admin` = ".sql_val($logged_user);
$result = $conn->query($check_admin);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$members_id = $row['members_id'];
$is_admin = $row['is_admin'];
$is_mod = $row['is_mod'];
$username = $row['username'];
$password = $row['password'];
$email = $row['email'];
$login_date = $row['login_date'];
$login_time = $row['login_time'];
$session = $row['session'];
}}
?>
<?php
if ($is_admin == 1){
echo 'Is Admin';
}
else
{
echo 'Is not Admin';
}
?>
this is my output:
Notice: Undefined variable: is_admin in C:\wwwroot\htdocs\snippet\is_admin.php on line 30 Is not Admin
which don't make sence.