Re: class and pictures from database
| From: | Brian White | Date: | Tue, 09 Oct 2001 22:21:08 +0000 |
| Subject: | Re: class and pictures from database | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70547@lists.php.net to get a copy of this message | ||
Ok. You can't embed an image in a HTML file ( see caveat below) . All an HTML
file can contain is HTML markup. All images have to be as the result of
some kind of reference and a separate HTTP request.
So, you have two choices
1) The "getimage.php?id=" method that you referred to
Advantages: Clean
2) Writing the image to a temporary file and
Advantages: Probably faster in your case and conceptually simpler
Disadvantage: Figuring out how to delete all those damn temporary
files at some pointThe caveat is that there IS a way to write out images using HTML and CSS ( I think - there was a thread about a "Kewl Script" a week or two back that described it ) but I think it is likely highly inefficient. Personally, I would go with the getimage.php method. Brian At 23:13 9/10/2001 +0200, Mitja Pagon wrote:
Hi! I have a class that is used for getting news from the database. Each property of the class relates to a field in the database. One of those fields is a BLOB that contains a picture. How do I get that picture shown on the page?? If i just echo the property I get a bunch of wierd charachters(image string). Also using the ImageCreateFromString doesn't seem to work. I've tried the "getimage.php?id=" method, but I don't like the fact that I have to access the database again, since I already got the picture from the database using the object. I hope any of this makes any sense :), I'm kind of new to PHP. Thanks, Mitja -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net------------------------- Brian White Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy Phone: +612-93197901 Web: http://www.steptwo.com.au/ Email: bwhite@steptwo.com.au