PHP 和MySQL:解決「mysqli_num_rows() 期望參數1 為mysqli_result,給定布林值」錯誤
if (mysqli_num_rows($dbc) == 0) {
$dbc = mysqli_query($mysqli,"SELECT users.*, profile.* FROM users INNER JOIN contact_info ON contact_info.user_id = users.user_id WHERE users.user_id=3");
SELECT users.*, profile.* --You do not join with profile anywhere. FROM users INNER JOIN contact_info ON contact_info.user_id = users.user_id WHERE users.user_id=3");
$dbc = mysqli_query($mysqli,"SELECT users.*, profile.* FROM users INNER JOIN profile ON contact_info.user_id = users.user_id WHERE users.user_id=3");
以上是為什麼「mysqli_num_rows()」傳回布林值而不是結果集?的詳細內容。更多資訊請關注PHP中文網其他相關文章!