I'm lost, see the code below. It's supposed to PHP echo "You're banned" if a record exist in db+table web_wan.blockaccount where the column name "isban" equals 1. However when testing, adding a row in the table:
id - username - isban
1 myuser 1
Nothing happens, site loads normally. I checked connection it's fine + finding column. Any ideas? SESSION should also work, otherwise I wouldn't be able to visit the page at all.
<?php
$query = $con->query("select id from web_wan.blockaccount where isban='1' and username ='.$_SESSION[username].'") or die($con->error);
while($row = $query->fetch_array())
{
if(!empty($row))
echo "Your Account denied access to this site!";
exit;
}
?>
PS. I'm new to PHP.