Re: [PHP-DB] to BLOB, or not to BLOB, that is the ? From: Tyson Lloyd Thwaites (tysonlt <email protected>)
Date: 08/31/00

It's not that hard, actually.

The CONS of storing content in a database is that yes, it is slightly
slower. Also, you have to upload your
images to your database via a PHP script everytime you want to add/modify an
image.

The PROS...the main reason that content is stored in a database is to make
things easier for very large sites.
This is typically when you would use an application server or a document
management system. (That's when you
administer your entire site from a web page...you can upload images, change
page text...good fun.)

If it is not a HUGE site, I would actually store the path to the image in
the database. File system reads are faster
than database reads, and you still have the convenience of database storage.

All you need to do then is echo the path of the image from the database. EG:

ID image_path
---------------------------------------------
1 /images/wherever/tyson.gif

echo "<img src=" . mysql_result("image_path", $db) . ">";

Sorry if the mysql syntax is wrong!

----- Original Message -----
From: Larry Linthicum <webmaster <email protected>>
To: <php-db <email protected>>
Sent: Friday, September 01, 2000 12:13 AM
Subject: [PHP-DB] to BLOB, or not to BLOB, that is the ?

I want to build a database driven "Photo Gallery" on my site and I would
like a list of the PROS and CONS of storing images as blob fields in MySQL,
as opposed to storing a URL for the image

Of particular interest are loading speed, resource usage, ease of coding
for output pages, ease of image resizing [hopefully on the fly] to produce
thumbnails.

Your thoughts, suggestions, and opinions, would be greatly appreciated.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>