PHP中的错误:警告:mysqli_num_rows()期望... [英] Error in PHP:warning: mysqli_num_rows() expects...

查看:96
本文介绍了PHP中的错误:警告:mysqli_num_rows()期望...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完整错误:

The full error:

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in __________ on line 16





我的代码:(因隐私问题而被删减)





My code: (Censored for privacy issues)

<?php

session_start();

$con = mysqli_connect('localhost','__________________','__________');

mysqli_select_db($con, '_____________________');

$email = $_POST['email'];
$pws = $_POST['psw'];

$s="select * from 'usertable' where email = '$email' && pws = '$pws'";

$result = mysqli_query($con, $s);

$num = mysqli_num_rows($result);

if($num == 1) {
        header('location:index.html');
    }else{
}

?>





我尝试了什么:



我试过改变mysqli_num_rows($ result);到mysqli_result($ result);



What I have tried:

I have tried changing mysqli_num_rows($result); to mysqli_result($result);

推荐答案

con = mysqli_connect(' localhost'' __________________'' __________');

mysqli_select_db(
con = mysqli_connect('localhost','__________________','__________'); mysqli_select_db(


con,' _____________________' );

con, '_____________________');


电子邮件 =
email =


这篇关于PHP中的错误:警告:mysqli_num_rows()期望...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆