title: Unable to display image from database using PHP
body: <p>Screenshot of the code:
  <img src="https://i.stack.imgur.com/BEM9d.jpg" alt="screenshot"></p>
  
  <pre><code>if ($_SERVER['REQUEST_METHOD'] == 'GET') {
      require ('../../mysqli_oop_connect.php'); //Connect to the database.
      $errors = array(); // Initialize an error array.
  
  // Check for an isbn:
  if (empty($_GET['isbn'])) {
      $errors[] = 'You forgot to enter the ISBN-13.';
  } else {
      $isbn = $mysqli-&gt;real_escape_string(trim($_GET['isbn'])); 
  }   
  
  if (empty($errors)) {   
      //Make the query:
      $q = "SELECT * FROM books WHERE isbn=$isbn";
      $r = $mysqli-&gt;query($q);
      $num = $r-&gt;num_rows;
  
      if ($num == 0) { // If it fails to run:
          echo "&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This book is currently not listed in our database. Would you like to add it?&lt;/p&gt;\n";
          //HERE IS WHERE IT NEEDS TO REDIRECT TO A PAGE THAT ALLOWS THE CONTENT TO BE ADDED TO THE DB LIKE REGISTER.PHP DOES.
      } else { //If it suceeds then run the query:
          echo '&lt;h1&gt;Is this your book?&lt;/h1&gt;';
  
      while ($row = $r-&gt;fetch_object()) { // POST DATA FROM DB.
          echo '&lt;img src="$row-&gt;image" height="100" width="100"&gt;' . '&lt;br /&gt;' . $row-&gt;name . '&lt;br /&gt;' . $row-&gt;isbn ;
  </code></pre>
  
  <p><em>The rest of the code is just closing the DB connection.</em></p>
  
  <p>I don't know what that icon means or where the issue is in the code. The DB is setup with three columns in a table: image, isbn, and name. The goal is to get the book to display the data being retrieved from the database. It is displaying all three items from the database based on the query, except the image is something else. The HTML is recognizing that there is an image being retrieved because when I just do $row->image it freaks out and posts random nonsense, as it should when there is an image being displayed like that. Any help is greatly appreciated.</p>