Hello,
I am trying to display binary blob images.
I am getting the following error:
Warning: picture not found in MySQL result index 2 in /home/httpd/virtual/display_photo.php on line 11
Warning: Cannot add header information - headers already sent by (output started at /home/httpd/virtual/display_photo.php:11) in /home/httpd/virtual/display_photo.php on line 12
Warning: Cannot add header information - headers already sent by (output started at /home/httpd/virtual/display_photo.php:11) in /home/httpd/virtual/display_photo.php on line 13
Here is how I am trying to get the image
<img src="display_photo.php?photo_id=<?= $row['Id'] ?>">
Here is display_photo.php
<?
$username="XXX";
$password="XXX";
$database="XXX";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "select medium_photo from residential where Id='$photo_id'";
$result = MYSQL_QUERY($query);
$data = MYSQL_RESULT($result,0, "picture");
header("Content-type: image/jpeg");
header("Content-Disposition: inline; filename=$photo_id.jpg");
echo $data;
?>
Any idea on what I am doing wrong?
Thank you....