This is driving me crazy.
I have a mysql db I'm trying to use to verify whether an account is an admin account or not, based on a bool value of 0 (not admin) or 1 (admin).
For whatever reason, my if statement isn't working correctly. Hopefully someone can help.
Basically I cant get the admin's to go to the admin page and the members to the members page. The members can somehow get to the admin page. These are literally just test pages I've setup that tell you which page your on.
Here's part of my code:
PHP Code:
$admin = mysql_query('SELECT admin FROM users');
if ($admin == 0) {
//then redirect them to the members area
header("Location: members.php");
}
else
{
//then redirect them to the admin area
header("Location: admin.php");
}