我檢查記錄是否存在:mysql_num_rows導致內部服務器錯誤
$query = "SELECT * FROM `collegeInfo` WHERE `name` = '$name' ";
$existed = mysqli_query($con, $query);
echo mysql_num_rows($existed);
第三行給我的錯誤:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
什麼建議嗎?謝謝!
您需要添加錯誤檢查。嘗試'$ exists = mysqli_query($ con,$ query)或die(mysqli_error($ con));' – Barmar
另外,當您遇到500錯誤時,您應該檢查服務器上的PHP錯誤日誌以獲取詳細信息。 – Barmar
爲什麼不迴應'mysqli_error($ con)'? –