$stmt = $db->prepare("SELECT * FROM user WHERE name='Steve Job'");
$stmt->execute();
if($stmt->num_rows){
echo "1";
}
它在我的ajax回调中返回空白。我已经调试好几个小时了。
答案 0 :(得分:1)
$stmt = $db->prepare("SELECT * FROM user WHERE name='Steve Job'");
$stmt->execute();
$stmt->store_result();
$numRows = $stmt->num_rows;
if($numRows > 0){
echo "1";
}
在使用store_result
num_rows