From: Karl DeSaulniers on 3 Feb 2010 02:37 Hello List, Forgive me if this is a noob question, but is it possible to fill a database table with actual image data, IE a jpeg? And then call that data to display the image? Or is it better to just reference it stored on the server somewhere and just put the url in the database? Thanks, Karl DeSaulniers Design Drumm http://designdrumm.com
From: Karl DeSaulniers on 3 Feb 2010 02:54 Ok, now here is another question from what you stated. Is there a way to compress the image data before storing, like a zip archive does to files? Thanks for your response. Karl On Feb 3, 2010, at 1:45 AM, Chaitanya Yanamadala wrote: > It i possible to store the image in the database. But it will > increase the database size. > So try referring the URL.. Karl DeSaulniers Design Drumm http://designdrumm.com
From: Phpster on 3 Feb 2010 08:02 Sure is. Save the data in a blob field. Lots of examples on the net on how to get it there and back out again. Note that you will also find arguments about whether or not to do it in the first place. I prefer not to, as it causes significant performance issues when the image table gets to a certain size. Bastien Sent from my iPod On Feb 3, 2010, at 2:37 AM, Karl DeSaulniers <karl(a)designdrumm.com> wrote: > Hello List, > Forgive me if this is a noob question, but is it possible to fill a > database table with actual image data, IE a jpeg? And then call that > data to display the image? > Or is it better to just reference it stored on the server somewhere > and just put the url in the database? > Thanks, > > Karl DeSaulniers > Design Drumm > http://designdrumm.com >
From: Patrick Price on 3 Feb 2010 08:20 I would say that only if this is going to be a very small project should you think about storing the images in the db. I had a contract job for a real estate company that had stored all their images in the database. They had ~25K rows of data where each image was ~5K and their website was going down weekly. I had to rewrite the entire image upload/retrieval system for their site to change it to folder based storage. Just my thoughts... Thanks patrick On Wed, Feb 3, 2010 at 8:02 AM, Phpster <phpster(a)gmail.com> wrote: > Sure is. Save the data in a blob field. Lots of examples on the net on how > to get it there and back out again. > > Note that you will also find arguments about whether or not to do it in the > first place. I prefer not to, as it causes significant performance issues > when the image table gets to a certain size. > > Bastien > > Sent from my iPod > > > On Feb 3, 2010, at 2:37 AM, Karl DeSaulniers <karl(a)designdrumm.com> wrote: > > Hello List, >> Forgive me if this is a noob question, but is it possible to fill a >> database table with actual image data, IE a jpeg? And then call that data to >> display the image? >> Or is it better to just reference it stored on the server somewhere and >> just put the url in the database? >> Thanks, >> >> Karl DeSaulniers >> Design Drumm >> http://designdrumm.com >> >> > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
From: Karl DeSaulniers on 3 Feb 2010 11:07
Thank you all for your numerous responses. I hear you loud and clear. I was wanting to see if it would be less of a burden on the server and secure my images better to put the images inside a database, but as you all have almost uniformly stated, this would not be the best situation. I currently have all my images referenced by url in my database and stored in a folder/s and I think I will keep it that way... Thanks for your 2 cents, :) Karl |