Re: SQL Graphics

From: Date: Fri, 11 Aug 2000 06:15:27 +0000
Subject: Re: SQL Graphics
Groups: php.db 
Request: Send a blank email to php-db+get-1950@lists.php.net to get a copy of this message
Addressed to: "Chris Adams" <chris@digitaria.com> php-db@lists.php.net ** Reply to note from "Chris Adams" <chris@digitaria.com> Wed, 9 Aug 2000 21:42:32 -0700 > > >I am am using MySQL to store graphic images as blob types. > >I then send them out to the web browser using the header > >function to display them. The problem is I have to use > >the header function as the very first thing sent to the > >browser. I can't display additional images after the > >first one because they get ignored. Is there another way > >to output image (gif,jpg,png) raw data? > > I think there's some misunderstanding here - you can't send multiple > images. When you generate HTML that includes something like <IMG > SRC="images.php?ID=5"> the browser will make a single request for a > single file. If you have <IMG SRC="images.php?ID=6"> the browser will > make a completely separate request for it. > > The answer, of course, is to break out your images into a separate > table. You could have something as simple as a row which contains the > image idea and a blob holding the image, or perhaps something a little > more advanced: I disagree... You dont have to have a separate TABLE. You do have to have a separate PROGRAM. The image grabber can pull the image from the same table as the program that called it, no problem. On the other hand, since you have to have a separate HTTP transaction that activates a separate httpd process and a separate database transaction, I don't think it is a good idea to put the image in the database at all. Just put the file name in the database and let HTTP handle sending the Image like it was designed to. Rick Widmer Internet Marketing Specialists www.developersdesk.com

« previous php.db (#1950) next »