Re: can i display an image _directly_ from postgres db storage?

From: Date: Tue, 02 Nov 2004 04:50:18 +0000
Subject: Re: can i display an image _directly_ from postgres db storage?
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-37119@lists.php.net to get a copy of this message
Tutorials that shows how to upload and store image/binary files in a database also usually shows how to retrieve them (and in the case of images, also how to display them). One function you'll find useful is imagecreatefromstring()
thanks. i found an example for uploading an image into the proper database field, which ***seems*** to have worked. and i found another example for pulling it back out to use directly in html code: <?php $dbconn = pg_connect("host=1.2.3.4 port=5432 dbname=mydb user=myname password=mypass"); $result = pg_exec($dbconn, "SELECT $image FROM thetable where name='$name'); $image = stripcslashes(pg_result($result, 0, 0)); header("content-type: image/gif"); echo $image; ?> ... BUT it's giving me the following error: Parse error: parse error, unexpected T_STRING in /myfolder/gif.php on line 5 that's the header() line, but what could the problem be? thanks. - philip

« previous php.db (#37119) next »