Re: SHOW PICTURE FROM DATABASE
| From: | Steve Cayford | Date: | Mon, 30 Dec 2002 23:07:26 +0000 |
| Subject: | Re: SHOW PICTURE FROM DATABASE | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24469@lists.php.net to get a copy of this message | ||
Some suggestions...
On Monday, December 30, 2002, at 03:55 PM, Nikos Gatsis wrote:
where showpict.php: $query="SELECT pict FROM pict WHERE pro_id= '$pro_id";(You're missing an end ' there, but apparently that's not the problem)
$result=mysql_db_query($database, $query, $conn) or Die (mysql_error()); list($photo)=mysql_fetch_row($result); $type = $photo_type;Where did the $photo_type variable come from? What's in it?
if (!empty($photo)) { header("Content-Type: {$type}");I believe this header should be in the form header("Content-Type: image/jpeg") or whatever image type you have. You should probably include an additional header header("Content-Length: " . strlen($photo));
echo $photo; } THANX Nikos