php-db | 2002122

Re: [PHP-DB] SHOW PICTURE FROM DATABASE From: Steve Cayford (steve_cayford <email protected>)
Date: 12/30/02

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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php