I have this short script that instead of displaying the images, displays the raw biary data stored in the blob. Where am I going wrong please?
<?php
@mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
@mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$result = mysql_query("SELECT * FROM image ORDER BY image_id");
while($row = mysql_fetch_array($result)){
header("Content-Type: {$row['mime_type']}");
echo $row["pix"];
}
?>
Thanks in advance
Stephen