mysqli_num_rows() expects parameter 1 to be mysqli_result
我的代碼是跟著老師打的,檢查了很多遍一模一樣,可是它提示我Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in D:\\xampp\\htdocs\\lianxi\\dologin.php on line 12,然后檢測發(fā)現(xiàn)我并沒有接收到表單提交過來的數(shù)據(jù),大佬們,我的代碼問題有可能出現(xiàn)在哪里,我看到網(wǎng)上說You have to test for the return value before using it as a result set. You must have an error in your SQL statement.但是我確實(shí)在sql語句上沒看出毛病,還有其他錯(cuò)誤可能嗎。
2019-04-01
2018-01-04
這句錯(cuò)誤是說 這個(gè)函數(shù)必須需要一個(gè)參數(shù) ,也就是mysqli_query($sql,$conn)的返回值,我覺得還是你的sql語句出現(xiàn)問題了,你可以打印sql語句再去數(shù)據(jù)庫里執(zhí)行看會(huì)不會(huì)得到結(jié)果。