First, you go and do a Query to see if there are any records with that username, and the admin field checked on. If there are, then that username is an admin. This won't work however if there are multiple users with the same username, so you might want to use a user ID instead.
function check_admin($username)
{
// Look for a person with that username, and the admin field is set to ON
$sql = 'SELECT * FROM TABLE WHERE User_Name="'.$username.'" AND Admin=1';
$result = mysql_query($sql);
// If there are any results, the person should be an admin (given usernames are unique)
if(mysql_num_rows($result) !== 0)
{
return true;
}
else
{
return false;
}
}
Then you would just use it as a check
if(check_admin("bob") == true)
{
// super secret admin stuff
}