gpt4 book ai didi

php - mysqli_num_rows 错误

转载 作者:太空宇宙 更新时间:2023-11-03 12:04:25 26 4
gpt4 key购买 nike

<分区>

这段代码有什么问题:

<?php

session_start();

if(!isset($_SESSION['username']) && isset($_COOKIE['username'], $_COOKIE['password']))
{
$checkQuery = "SELECT password, id FROM accounts WHERE username='".$db->real_escape_string($_COOKIE['username'])."'";
$checkResult = mysqli_query($db, $checkQuery);
$check = mysqli_fetch_array($checkResult);
if($check['password'] == $_COOKIE['password'] && mysqli_num_rows($checkQuery)>0)
{
$_SESSION['username'] = $_COOKIE['username'];
$_SESSION['userid'] = $check['id'];
}
}



?>

它显示了这个错误:

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, string given...

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com