<?
$id = $_GET['id'];
if($id){
@mysql_connect("localhost","username","pswd");
@mysql_select_db("db_name");
$query ="SELECT file,type FROM db_table WHERE id=$id";
$result = @mysql_query($query);
$data = @mysql_result($result,0,"file");
$type = @mysql_result($result,0,"type");
Header( "Content-type: $type");
echo $data;
};
?>
ok when i use this to get an image from a blob i set the url as get_img.php?id=1
or watever and it works fine
works for all fields except 0
dont understnad why … i hope my question makes sense
like http://www.mysite.com/get_img.php?id=0
doesnt work but every field after that works fine
http://www.mysite.com/get_img.php?id=1
http://www.mysite.com/get_img.php?id=2
http://www.mysite.com/get_img.php?id=3
and so on and so forth
thanks