You need to create a seperate file for pulling up your images only.
something like:
<?
@MYSQL_CONNECT("localhost", "user", "pass") ;
@mysql_select_db("my_db");
$query = "select bin_data,filetype from pictures where id=$id";
[COLOR=green]// bin_data is the blob, filetype .jpg, .gif...[/COLOR]
$result = @MYSQL_QUERY($query);
$data = @MYSQL_RESULT($result,0,"bin_data");
$type = @MYSQL_RESULT($result,0,"filetype");
Header( "Content-type: $type");
echo $data;
?>
I save it as picture.php then when ever i need to pull an image out of a database is use:
<img src="picture.php?id=$id">
and this way you can use the image like any other image!