Re: to BLOB, or not to BLOB, that is the ?

From: Date: Fri, 01 Sep 2000 00:20:15 +0000
Subject: Re: to BLOB, or not to BLOB, that is the ?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-2542@lists.php.net to get a copy of this message
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@RetrieverSports.net> To: <php-db@lists.php.net> 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.

« previous php.db (#2542) next »