Hello!
I am storing images as binary data in a blob field. The uploading process is working just fine, but I have this problem displaying the images from my database. I realise that many others have had similar problems too, but I've tried just about every type of solution that I've been able to find, and nothing seems to do the trick.
The source of my problem seems to be in the image tag:
<IMG SRC="getpicture.php?username=<?php echo $row['username']; ?>">
The php echo does display the appropriate username, but the problem seems to be that the file getpicture.php never gets executed. I've tried putting some test-code in there as well, which should print no matter what, but nothing displays, so therefore the conclusion must be that the file never is executed. Has anybody got any ideas as to what I could do to fix this problem?
I would be ever so grateful if someone could give me any hints at all.
Best Wishes
Nina Kristensson
The code in getpicture.php is as follows:
<?php
if($username)
{
dbconnection();
$query = "select picture from user where username='$username'";
$result = MYSQL_QUERY($query);
$data = MYSQL_RESULT($result,0, "picture");
$data=stripslashes($data);
header("Content-type: image/jpeg");
echo $data;
}
?>