gpt4 book ai didi

php - 给出警告 : mysql_num_rows() expects parameter 1 to be resource, 对象

转载 作者:IT老高 更新时间:2023-10-29 00:09:33 25 4
gpt4 key购买 nike

$q="SELECT * FROM tbl_quevote WHERE que_id = '".$qid."' and voteby='".$uid."'";

$result = $mysqli->query($q) or die(mysqli_error($mysqli));
$num_rows = mysql_num_rows($result);

echo $num_rows;

错误:

Warning: mysql_num_rows() expects parameter 1 to be resource, object given in C:\xampp\htdocs\shizin\voting.php on line 13

如何判断结果为空?

最佳答案

$num_rows = $result->num_rows;

关于php - 给出警告 : mysql_num_rows() expects parameter 1 to be resource, 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3434601/

25 4 0