我需要帮助检查是否存在行.我收到"电子邮件不再存在publisher@example.com".
有没有更好的方法来检查mysqli是否存在行?
email no longer exists publisher@example.com
Run Code Online (Sandbox Code Playgroud) 我一直无法使用mysqli获取返回的行数.我每次都回来0,尽管肯定会有一些结果.
if($stmt = $mysqli->prepare("SELECT id, title, visible, parent_id FROM content WHERE parent_id = ? ORDER BY page_order ASC;")){
$stmt->bind_param('s', $data->id);
$stmt->execute();
$num_of_rows = $stmt->num_rows;
$stmt->bind_result($child_id, $child_title, $child_visible, $child_parent);
while($stmt->fetch()){
//code
}
echo($num_of_rows);
$stmt->close();
}
Run Code Online (Sandbox Code Playgroud)
为什么不显示正确的数字?