慕斯709654
您需要先调用MySqli_Stmt::store_result()num_rows查找: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(); $stmt->store_result(); num_rows; $stmt->bind_result($child_id, $child_title, $child_visible, $child_parent); while($stmt->fetch()){ //code } echo($num_of_rows); $stmt->close();}请参阅上的文档MySQLi_Stmt->num_rows,该文档显示在页面顶部附近(在主要说明区域中)...