Display BLOB from mySQL with php
<p>After I managed it to insert blobs into my db I'm trying to Display a BLOB from MySQL. </p>

<p>This is the getImage.php:</p>

<pre><code>&lt;?php
  $id = $_GET['id'];
  // do some validation here to ensure id is safe

  $link = mysql_connect("localhost", "root", "root");
  mysql_select_db("user_auth_tutorial");
  $sql = "SELECT image FROM testblob WHERE image_id='$id''";
  $result = mysql_query("$sql");
  $row = mysql_fetch_assoc($result);
  mysql_close($link);
  header("Content-type: image/jpeg");
  echo $row['image'];
?&gt;
</code></pre>

<p>Here the HTML:</p>

<pre><code>&lt;img src="getImage.php?id=1" width="200" height="200" /&gt;
</code></pre>

<p>This is the content of my db:
<img src="https://i.stack.imgur.com/Ulo4U.png" alt="table testblob"></p>

<p>Unfortunately Dev-Tools throw an internal server 500 Error.
Browser-Output:
<img src="https://i.stack.imgur.com/iDInF.png" alt="Screenshot"></p>

<p>Can anybody tell me what I do wrong?</p>

<p>Thank you so much!</p>