Hi guys
Ive written a function which checks if the user is admin or not...
function checkadmin($login)
{
global $link;
$login = $_SESSION["login"];
$query="SELECT login, admin_type FROM admin WHERE login='$login' and admin_type='yes'";
$result=mysql_query($query, $link)
or die("checkPass fatal error: ".mysql_error());
// Check exactly one row is found:
if(mysql_num_rows($result)==1)
{
$row=mysql_fetch_array($result);
return true;
}
//not admin:
return false;
}
and to test this system I have writen this if statement
if (checkadmin(true))
{
print "U are admin user ";
print("<BR>");
}
else
{
print "u are not admin user";
}
when refering back the database the user created keeps on get the 2nd message and I have not got a clue as to why?
any help would be much appreciated........