try another color scheme:


Go Back   TECH6.0 > Get Techie > Programming > Databases


Image Gallery in a database

This is a discussion on Image Gallery in a database within the Databases section, part of the Programming category; Hi all I am building an image gallery in a MySQL database and I have run into a bit of ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 28-03-2009, 07:42 PM
TaL's Avatar
TaL TaL is offline

Moderator
 
Name: Steve
Join Date: Dec 2008
Location: Canada
Posts: 75
TaL will become famous soon enoughTaL will become famous soon enough
Default Image Gallery in a database

Hi all

I am building an image gallery in a MySQL database and I have run into a bit of a snag. I can store my images in a longblob type but I am having issues getting them to display from the database. I am wondering if anyone here has experience with images stored in databases.

I know there is a raging debate on wether this is the right way to go (as opposed to filesystem storage of the images) but I wanted to try this to see if I can get it to work.

I am able to access all my file attributes from the database but when I try and display back the image, it comes out as garbled ASCII type text. I have read that you have to set the header to an image type but I already have the header set earlier in my page.

If someone here has experience with doing this and is willing to help out, I can post my code
__________________
Go placidly amid the noise and haste, and remember what peace there may be in silence

The Desiderada
Reply With Quote
  #2  
Old 28-03-2009, 09:22 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

I have never tried this myself. So I'll rather point you to a nice tutorial. I just went through it and looks pretty straight forward.

http://www.phpriot.com/articles/images-in-mysql
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #3  
Old 14-09-2010, 12:39 PM
No Avatar

Learner
 
Join Date: Sep 2010
Posts: 9
thomas james is on a distinguished road
Default

There are many databases available in the market. The most popular are the Oracle and SQL Server. The Oracle database is from the Oracle Corporation and the SQL Server is from the Microsoft Corporation. There are freely available database like MySQL.
Reply With Quote
  #4  
Old 17-08-2011, 11:33 AM
No Avatar

Learner
 
Join Date: Mar 2011
Posts: 18
rachard1583 is on a distinguished road
Default

To store an image in to sql server, you need to read image file into a byte array. Once you have image data in byte array, you can easily store this image data in sql server using sql parameters. try the :shabdar.org/sql-server/105-store-save-images-in-sql-server.html
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes




All times are GMT +5.5. The time now is 12:35 AM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top