Professional-PHP
[Prev] Thread [Next] | [Prev] Date [Next]
[Pro. PHP Dev.] Re: I saved images in mysql database (blob) I am unable to get all images at once Robert Gonzalez Fri Jun 26 10:01:06 2009
Keep in mind that after the first loop iteration your are throwing a
"headers already sent warning" and that none of the headers sent after the
first one are actually sent. Still, I think you should display the images
rather than try to output them. Actually, if you need all of them, you
*could* write them all to the file system, zip them up, then offer the zip
for download. That just seems like not a good idea though.
On Fri, Jun 26, 2009 at 4:26 AM, anjith <[EMAIL PROTECTED]>wrote:
>
>
> Yes i also thought about filesystem but cilent requirement is to save
> all images in database and retrieve them
> On Jun 26, 3:53 pm, "Yura A." <[EMAIL PROTECTED]> wrote:
> > Hi anjith ,
> >
> > 1. Storing images data is not a good solution in most cases, so you
> > have to avoid this and store images in the file system.
> >
> > 2. You can't send more than one image to the browser in one HTTP
> > connection. Therefore best solution for you is to generate a set of
> > HTML img tags
> > e.g.
> >
> > while( ($row=mysql_fetch_assoc($rs)) !== false) {
> > echo "<img src="image.php?id=" . $row["image_id"];
> >
> > }
> >
> > and create image.php which
> > - reads one blob data from db ( by image id )
> > - sends "Content-type: image/jpeg" and image data to the brawser
> > i.e. sends one image per request to the browser.
> >
> > Hope this will help.
> >
> > --
> > Yura
> >
>
--
Robert A. Gonzalez
--~--~---------~--~----~------------~-------~--~----~
This group is managed and maintained by the development staff at 360 PSG. An
enterprise application development company utilizing open-source technologies
for todays small-to-medium size businesses.
For information or project assistance please visit :
http://www.360psg.com
You received this message because you are subscribed to the Google Groups
"Professional PHP Developers" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Professional-PHP
-~----------~----~----~----~------~----~------~--~---