title: How to view get image back from MySQL database
body: <p>I have uploaded an Image in my database. The datatype is BLOB. Now I want to view this image in my browser. I have written the following code but its not  generating the image. Kindly check it.</p>
  
  <p>Thanks</p>
  
  <pre><code>&lt;?php
  
      include 'connect.php';
      //$id= $_GET['product_id'];
  
      $query_images = "SELECT image FROM product_images WHERE product_id=121";
  
      if (!$query_images_result = mysql_query($query_images))
      {
          echo mysql_error();
      }
      else
      {
  
           $fetch_images = mysql_fetch_array($query_images_result);
  
           $print_images = $fetch_images['image'];
  
           header('Content-type:image/jpeg');
  
           echo $print_images;
      }
  
  ?&gt;
  </code></pre>
  
  <p>File 2</p>
  
  <pre><code>&lt;body&gt;
  
  &lt;img src='single_product_image_show.php' alt="image" /&gt;
  
  &lt;/body&gt;
  </code></pre>