title: Broken image icon displays while trying to display a BLOB
body: <p>Okay, so my end goal is to display an image (or multiple in a blog type style) that is stored in a database(<em>MySQL</em>) as a <em>blob</em>. Right now it display a broken image icon (<img src="https://i.stack.imgur.com/RUgDb.png" alt="enter image description here">). This is what I've tried so far:</p>
  
  <pre><code>&lt;?php
      $link = mysql_connect('HOST','USER','PASS!') or die("Could not connect to database");
      $dbsel= mysql_select_db('DATABASE', $link) or die("Couldn't select database.");
  
      $result = mysql_query("SELECT * FROM bmblog");
  
      while($row = mysql_fetch_assoc($result))
      {
  
          echo "&lt;img src='php/imgView.php?imgId=".$row['media']."' /&gt;";
  
          echo "&lt;center&gt;" . "&lt;font color='white'&gt;" . "&lt;FONT FACE='timesnewromans'&gt;" . nl2br(htmlspecialchars($row['msg']));
  
          echo "&lt;br&gt;";
          echo "&lt;br&gt;";
      };
  
  ?&gt;
  </code></pre>
  
  <p>Also</p>
  
  <pre><code>echo "&lt;img src='data:image/jpeg;base64," . base64_encode($row['media']) . '" /&gt;';
  
  echo "&lt;center&gt;" . "&lt;font color='white'&gt;" . "&lt;FONT FACE='timesnewromans'&gt;" . nl2br(htmlspecialchars($row['msg']));
  </code></pre>
  
  <p>Both display the same broken image icon. I did notice however without trying to echo the second line (of <em>text</em>) I did get a full boarder around the broken image icon that would have been about the size of the image. This is not the same for the first method though.
  I've been searching for a few hours now and have found tons of post about this, but none that seemed to work for me or make sense, I am fairly new to PHP so this may be something simple I am missing; Either way thank you in advance for any help it is greatly appreciated!</p>