PHP准备了mysqli语句

时间:2015-09-01 12:43:12

标签: php mysql mysqli

我一直在处理准备好的陈述一段时间,直到今天我才遇到任何类型的问题。我有一个最离奇的问题。我有以下PHP代码:

$email= $_GET['email'];
$confirmKey= $_GET['confirmKey'];
$checkKey = "select email from EmailConfirmations where email = ? and confirmKey = ? LIMIT 1;";
if($stmt = $conn->prepare($checkKey )){
    $stmt->bind_param("ss",$email,$confirmKey);
    $stmt->execute();
    $stmt->bind_result($result);
    $stmt->store_result();
    $stmt->fetch();
    if($stmt->num_rows > 0){
        echo "Correct Key";

    }else
        echo "Incorrect Key";

    $stmt->close();


}else
    echo "Error: " . $stmt. "<br>" . mysqli_error($conn);

无论如何,我总是得到一个空的结果集。我甚至检查了参数在发送之前是否有值,是的,它们在发送之前确实包含了值。我不知道我做错了什么。我运行SQL脚本,它工作正常。请帮忙

0 个答案:

没有答案