...sorry for the japanese, but this will solve any of those problems
Code:
<img src="/display.php?id=34" border="0">
then
Code:
<?
$connection=@mysql_connect(...);
@mysql_select_db(...);
$query="SELECT mime, file FROM images WHERE id=".$_GET["id"];
$rawdb=@mysql_query ($query,$connection);
if($rawdb AND @mysql_num_rows($rawdb)>0){
$array=@ mysql_fetch_array($result);
if (!empty($array["fileContents"])){
// Output the MIME header
header("Content-Type: ".$array["mime"]}");
// Output the image
echo $array["file"];
}else{
// something else...
}
@mysql_free_result($rawdb);
}else{
// something else...
}
@mysql_close($connection);
?>