Re: pictures stored in PostgreSQL DB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alain Roger wrote:

> Hi,
> 
> It's amazing that my previous post has raised so much consideration about
> the fact to store or not pictures into DB.

And yet you ask again!? Did you not learn? No good can come from this
question.

> However, none of those posts answered to my question... How can i retrieve
> and display those pictures to my PHP pages ?
> 
> Basically, on my PHP page I have some texts and I would like to extract
> from DB the pictures to display.
> Therefore, set the header to mine JPEG or GIF does not allow to have text
> also.

This is another problem with images in databases, unlike text or data which
can be incorporated into the HTML output stream, an image needs to be its
own file.

You will have to hit the database twice. Once to render the page, and again
to render the image.

To render the image you need to query the database and send the data back on
its own, but before you do, you have to set the content type header to
jpeg, gif, or whatever.

This is why I say image data does not belong in the database.
> 
> So please, how can i do to display pictures from DB, when my PHP page also
> include texts and other images (from filesystem) ?
> 
> In fact i would like to do something like a thumbnail...

You will need to repeat the same steps outlined above, but use image
manipulation utilities to reduce the image. Again, that's why you store
images in files and not in the database.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux