无论如何都没有执行第二个查询。我尝试删除第一个查询并仅执行第二个查询但仍然。仅在选择查询时才会发生这种情况。
<?php
include 'connect.php';
$func=$_GET['func'];
if($func=="login")
{
$u=$_POST['name'];
$p=$_POST['pwd'];
$query=mysqli_query($con,"select * from user where usr_id='$u' & usr_pwd='$p'");
$row=mysqli_fetch_array($query);
$query1=mysqli_query($con,"select * from usradmin where usr_id='$u' & usr_pwd='$p'");
$row1=mysqli_fetch_array($query1);
if($u==NULL || $p==NULL)
{
echo "Feilds Cennot Be Empty";
}
else
{
if($u==$row['usr_id'] && $p==$row['usr_pwd'])
{
echo "Login Success";
}
else if($u==$row1['usr_id'] && $p==$row1['usr_pwd'])
{
echo "Admin Login Success";
}
else
{
echo "Login Failed";
}
}
}
?>