image loaded from database does not show
<p>guys.
I tried to load image stored in mysql blob field with php, but the image does not show correctly. In firebug, I got these infos: get-image.php Dimensions0 × 0File size5.35KBMIME typeimage/jpeg</p>

<p>Here is my code</p>

<p>HTML</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Demo of Database Image in a page&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    Here is your picture:&lt;br&gt;
    img src=get-image.php?id=1 width=400 height=300&gt;&lt;br&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>PHP</p>

<pre><code>&lt;?php
include "db.php";
$conn = OpenDbConnection();
$key = $_GET["id"];
$tkey = "" . $key . "";
$strsql = "SELECT * FROM `images` WHERE `image_id` = " . $tkey;
$rs = mysql_query($strsql, $conn) or die(mysql_error());
if (!($row = mysql_fetch_array($rs))) {
    die("File not exists.");
}
header("Content-type: image/jpeg");
echo $row["content"];
mysql_free_result($rs);
mysql_close($conn);  
?&gt;
</code></pre>

<p>Please someone tell me what is wrong with my code?</p>
