I`m trying to display the picture from the database, but I can`t get it to
work. That`s just a short version of your script.

I try to display the picture like that:

<img src='showpic.php' width='150' height='80'>

and showpic looks like this:

<?php
$query = "select file_data,file_type, from pildid where id=1";
$result = @MYSQL_QUERY($query);
$data = @MYSQL_RESULT($result,0, "file_data");
$type = @MYSQL_RESULT($result,0, "file_type");
Header( "Content-type: $type");
$picture = $data;
print $picture;
?>


Any ideas why it might not work as expected? I have written picture to the
db, but ...? I write them like:
        $main           = addslashes(fread(fopen($main_pic, "r"),
filesize($main_pic)));
        $sql ->
insert("pildid","section,productid,picnr,file_name,file_type,file_data","'$section','$productid',0,'$main_pic_name','$main_pic_type','$main'");


Thanks in advance;
Siim EInfeldt


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to