Вот довольно простой пример отображения изображения, хранящегося в виде BLOB-объекта.
<?php
require_once ('./includes/db.inc.php'); // Connect to the db.
//let the browser know its an image
header("Content-type: image/jpeg");
// Make the query.
$query = "SELECT thumbnail FROM items where item_id=" . $_GET['item_id'];
$result = @mysql_query ($query);
if ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo $row['thumbnail'];
}
mysql_close(); // Close the database connection.
?>