嗨大家好,我仍然无法解决此错误消息:
警告:mysqli_num_rows()要求参数1为mysqli_result,布尔值在第11行的C:\ wamp64 \ www \ listing \ verify.php中给出
我尝试了不同的建议,但我仍然无法弄清楚如何解决它。
这是代码:
<?php
require_once('connect.php');
$key = isset($_GET['key']);
$id = isset($_GET['id']);
$sql = "SELECT * FROM usermanagement WHERE id=$id AND verify_key='$key' AND active=0";
$res = mysqli_query($connection, $sql);
/* determine number of rows res set */
$count = mysqli_num_rows($res);
if($count == 1){
$usql = "UPDATE usermanagement SET active=1 WHERE id=$id";
$ures = mysqli_query($connection, $usql);
if($ures){
$successmsg = "Account Activated Successfully";
}
else{
$failmsg = "Account Activation failed, contact support";
}
}
else{
$failmsg = "key not found in db";
}
?>