php admin login problem?

  • Thread starter Thread starter himitsu.girl
  • Start date Start date
H

himitsu.girl

Guest
i have a page and trying to check of the logged user is admin from a table called isadmin, if it is 1 then it is otherwise it is not. now i have not clue what kind of code i should use. this is what i came up with and i know its wrong. please any help?


$get = mysql_query("SELECT username FROM users WHERE isadmin = 1");
while ($row = mysql_fetch_assoc($get))
{
$admin = $_SESSION['gatekeeper'];
}

if ($admin == 1)
{ echo "you are admin"; } else echo "you are not admin";
?>
 
Back
Top