Ok i think I probably know the answer to this but I will ask to see what other people think.
Which would be a better way to store uploaded photos for a gallery that contains a row for each photo
Would it be better to store the image in the database or just store the filename of the image in the database and the image in a folder on the web server.
I am guessing it is probably better to store the image in a folder on the webserver do to the extra processing power I would think is involved in pulling the image from the database and then recreating it but maybe their is something I am missing here
Tim
PHP Images and MYSQL
Moderator: General Moderators
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
With files in general, it's almost always better to store files in the file system and store their references in the database. With images, the reference is probably always going to be placed in an IMG tag, and the only server-side processing required is to get that reference out of the database and print out the HTML.