我想获取该查询的num行。现在输出为空,我不知道该怎么办...
已编辑 我需要输入“?”输入文字。
我的代码:
$stmt = $conn->prepare("SELECT email FROM users WHERE email=?");
$stmt->bind_param("s", $email);
$stmt->execute();
$stmt->store_result();
$num_rows = $stmt->num_rows;
$stmt->bind_result($email);
$stmt->fetch();
echo $email;
if ($num_rows > 0)
{
echo "Exists";
}
else
{
echo "doesnt exists";
}
$stmt->close();
$conn->close();