| |||||||
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 ...
![]() |
|
| | LinkBack | Thread Tools | Display Modes |
|
#1
| ||||
| ||||
|
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 |
|
#2
| ||||
| ||||
|
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
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
|
#3
| ||||
| ||||
|
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.
|
|
#4
| ||||
| ||||
|
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
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |