When the user is banned it should echo out the banned echo but instead it echo\'s out the Failed login echo, Somewhere along the line I\'ve messed something up if someone could
place this line outside if
block
$SQL = $odb->prepare("SELECT `status` FROM `users` WHERE `username` = :username");
$SQL->execute(array(':username' => $username));
$status = $SQL->fetchColumn(0);
and in else part whaich says login failed do this
else // else for login failed
{
if($status == 1)
{
$SQL = $odb->prepare("SELECT `reason` FROM `bans` WHERE `username` = :username");
$SQL->execute(array(':username' => $username));
$ban = $SQL->fetchColumn(0);
echo ' ';
die('You are banned. Reason: ' . htmlspecialchars($ban));
}
echo ' ';
}
you also tried to print that banned for valid users too