View Single Post
Old 08-30-2006, 11:12 AM  
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
...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);

?>
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202

Last edited by borked; 08-30-2006 at 11:13 AM..
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote