我得到這一呼籲說一個成員函數fetch_array布爾線錯誤()23. 線23由該行代碼FETCH_ASSOC()錯誤
$row = $query->fetch_assoc();
這裏是整個塊
if(!filter_has_var(INPUT_GET, 'id')) {
echo "Error: book id was not found.";
require_once ('includes/footer.php');
exit();
}
$book_id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
$sql = "SELECT * FROM books WHERE book_id=" . $book_id;
$query = $conn->query($sql);
$row = $query->fetch_assoc();
echo'$ sql =「SELECT * FROM books WHERE book_id =」。 $ book_id; '檢查你的查詢 – Saty