I noticed now that you are checking Department for 2 different values instead of using the Permission for one of them. Change it to this and let me know.
PHP Code:
$check1=mysql_query("SELECT * FROM tbllogin WHERE Username='sammy' AND Department='HRAD' AND Permission='True'");
$check2 = mysql_fetch_array($check1);
if($check2['Username']=='sammy' && $check2['Department']=='HRAD' && $check2['Permission']=='True'){
$_SESSION['isallowed'] = $check2['Permission'];
If that stills does not work then you need to start echoing out the info you are getting from the db and compare it to the variables you want them to equal. So then do this:
PHP Code:
$check1=mysql_query("SELECT * FROM tbllogin WHERE Username='sammy' AND Department='HRAD' AND Permission='True'");
$check2 = mysql_fetch_array($check1);
$username = $check2['Username'];
$dep = $check2['Department'];
$permiss = $check2['Permission'];
echo "$username<br/>$dep<br/>$permiss<br/><br/>";
if($username=="sammy" && $dep=="HRAD" && $permiss=="True"){
$_SESSION['isallowed'] = $check2['Permission'];
Bookmarks