警告:mysqli_num_rows()期望参数1为mysqli_result,bono给出ina [英] Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given ina
本文介绍了警告:mysqli_num_rows()期望参数1为mysqli_result,bono给出ina的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么想法吗?它总是说(密码或电子邮件错误,请再试一次)
<!--start login form-->
<form name="userinfo_2" id="form_28" method="post" action="index.php" target="_self" enctype="application/x-www-form-urlencoded" class="OBJ-11" style="position:absolute;left:6px;top:12px;width:236px;height:140px;">
<input id="edit_1" name="email" class="OBJ-12" maxlength="50" style="position:absolute;left:92px;top:7px;width:134px;height:22px;">
<input id="edit_2" name="password" class="OBJ-12" maxlength="25" type="password" style="position:absolute;left:92px;top:37px;width:132px;height:22px;">
<input id="butn_1" name="login" class="OBJ-13" type="submit" value="Login" style="position:absolute;left:147px;top:74px;width:76px;height:22px;">
<input id="butn_2" name="Reset" class="OBJ-13" type="reset" value="Clear" style="position:absolute;left:144px;top:108px;width:81px;height:22px;">
<div id="txt_5" style="position:absolute;left:8px;top:38px;width:71px;height:16px;overflow:hidden;">
<p class="Normal"><span class="C-3">Password:</span></p>
</div>
<div id="txt_4" style="position:absolute;left:8px;top:8px;width:73px;height:16px;overflow:hidden;">
<p class="Normal"><span class="C-3">Email:</span></p>
</div>
</form>
<?php
include("includes/db.php");
if(isset($_POST['login'])){
$email = mysqli_real_escape_string($con,$_POST['email']);
$password = mysqli_real_escape_string($con,$_POST['password']);
$sel_user = "select * from jobseeker where admin_email='$email' AND password='$password'";
$run_user = mysqli_query($con, $sel_user);
$check_user = mysqli_num_rows($run_user);
if($check_user==1){
$_SESSION['admin_email']=$email;
echo "<script>window.open('home_user.php?logged_in=You have successfully Logged in!','_self')</script>";
}
else {
echo "<script>alert('Password or Email is wrong, try again!')</script>";
}
}
?>
推荐答案
_POST ['login'])){
_POST['login'])){
电子邮件 = mysqli_real_escape_string(
email = mysqli_real_escape_string(
con,
这篇关于警告:mysqli_num_rows()期望参数1为mysqli_result,bono给出ina的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文