无法解决错误消息php:尝试设置验证密钥

时间:2017-06-05 18:26:06

标签: php

嗨大家好,我仍然无法解决此错误消息:

警告: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";
}

?>

0 个答案:

没有答案