在php中获取错误需要布尔结果

时间:2016-04-29 21:12:18

标签: php mysqli

我收到此错误:

  

警告:mysqli_num_rows()要求参数1为mysqli_result,布尔值在第37行的C:\ xampp \ htdocs \ amix \ mal \ Hostel Management System \ GSHK \ index.php中给出

我的代码是:

if(isset($_POST[empsubmit]))
{
    $sqlquery = mysqli_query($dbconnection,"SELECT * FROM employee WHERE login_id='$_POST[login]' and password='$_POST[emppassword]' and status='Enabled'");
    $count = mysqli_num_rows($sqlquery);
    if($count == 1)
    {
        $msg1="<p><font color='green'><strong>Logged in successfully...</strong></font></p>";
        $rs = mysqli_fetch_array($sqlquery);
        $_SESSION[emp_id] = $rs[emp_id] ;
        $_SESSION[emp_designation] = $rs[emp_type] ;
        header("Location: dashboard.php");
    }
    else
    {
        $msg1="<p><font color='red'><strong>Failed to login...</strong></font></p>";
    }
}

0 个答案:

没有答案