RE: [PHP-DB] using php and mysql with images
| From: | php3 at developersdesk dot com | Date: | Thu, 29 Jun 2000 00:56:31 +0000 |
| Subject: | RE: [PHP-DB] using php and mysql with images | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-722@lists.php.net to get a copy of this message | ||
Addressed to: "Cosenza, Mario" <mcosenza@engsvcs.com>
php-db@lists.php.net
** Reply to note from "Cosenza, Mario" <mcosenza@engsvcs.com> Wed, 28 Jun 2000
12:35:38 -0400
>
>
>
> Check out
> http://www.phpbuilder.com/columns/florian19991014.php3.
> This is how I learned it.
>
> I still don't know the performance implications of doing this. Does
> anybody know how well MySQL handles blobs (expically lots of them?)
>
This has come up many times, and I think the consensus on the list is
that there is little to no advantage to storing your images in the
database. Store the images in a directory, and put the filename in the
database.
Since images are retreived by <IMG SRC="filename"> you have to provide
a separate program to get the image out of the database and send it.
There is no way to inline the images with the web page source when you
send it, it is always a separate transaction.
To get an image from the database you have to run a program,
open a database connection, transfer the image from db to program,
add the headers, and send it. It is easier and faster to let the web
server send the image file.
> Mario
>
>
> -----Original Message----- From: Matt Dooner
> [mailto:mdooner@mindspring.com] Sent: Wednesday, June 28, 2000 12:35
> PM To: php-db@lists.php.net Subject: [PHP-DB] using php and mysql
> with images
>
>
> Here's what I need to do; Take an image from a file input in an HTML
> form and, using php, put it into a mysql blob feild. Later, I need to
> take the blob and display it as an image on a web page. Is this
> possible and if it is, could someone please tell me how to do this. I
> have search though both the php and mysql docs and have found
> nothing.
>
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com