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");
}
I would do:
PHP Code:
$result = mysql_query("SELECT admin FROM users");
list($admin)=mysql_fetch_row($result);
switch ($admin){
case 0:
header("Location: members.php");
break;
case 1:
header("Location: admin.php");
break;
}
Hope that helps
Proxomos