Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to store image in mysql table

Status
Not open for further replies.

alsmurad

Programmer
May 15, 2003
2
US
i am new in myqsl. i need help, who one like to help me, i want to store image in mysql tale, how can i do it, what kind of data type , i have to declare when creating the tale. thank in advance
 
If you are writing a web application, I strongly recommend that instead of storing the image data in the database, you store the image on your server's filesystem and store the filename in your database.

If you store the data in the database, you will have to replicated in your code many of the functions of the web server -- and there's no point reinventing the wheel.

Want the best answers? Ask the best questions: TANSTAAFL!
 
I agree that blob type is needed. But I believe that each time your web visitor views the image, it will be read and downloaded from the db. I have IE6.0 and it doesn't seem to cache the image(s), making for a page re-load that is slower than if the images were stored in files on the server. Depending on the size and number of images on a page, that may or may not be an issue.

Please correct me if I'm wrong, but that's what I've noticed.
 
Of cource IE can't cache the graphics. The graphics are begin produced on-the-fly by a script.

If the graphics reside on the filesystem, then IE's caching mechanism can query the web server and find out the creation date of the file. Since fetching the graphic from a database means that the image is being produced on-the-fly, the cache thinks there is a new graphic every time.

Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top