title: fetch_assoc() error
body: <p>I am getting an error that says Call to a member function fetch_array() on boolean on line 23.
  Line 23 consists of this line of code</p>
  
  <pre><code>$row = $query-&gt;fetch_assoc();
  </code></pre>
  
  <p>Here is the whole block</p>
  
  <pre><code>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-&gt;query($sql);
  
  $row = $query-&gt;fetch_assoc();
  </code></pre>