collecting Profile information into MySQL database w\ images

A

Anonymous

Guest
I would like to create a profile page for folks in my motorcycle club. The question is, if I want to collect images to reference with the profile for later, should I create a script that will save the photos into a directory with the user name, or should I have the images uploaded into a table in MySQL? I think it would be easier to link the image to the user profile via a table, but is that even possible in MySQL? Any suggestions?
 
W/ regard to your question - it is possible to store images in a MySQL db using datatype Blob. It is really a matter of choice. However, I would tend to go with your first option - which is to upload the images to a certain folder, so as not to put strain on the database w/ the queries.
 
Sounds good. Does it make it harder to reference the image along with the profile information if I put the image in a seperate folder. I won't have the option or linking via Primary key I'm sure.

I think it would take less strain on the database if I use the photos on a seperate table from the profile information. That way it would only use that table when needed.

If I'm wrong please let me know.
 
For referencing, I suggest suffixing the image name w/ the PK. Example: for PK "001" - I would name the images associated w/ it "001_1.jpg", "001_2.jpg"... and so on.

Then again, storing the images on the db would work just as well. Still a matter of choice dude.
 
My advice would be to store the images in folders with a .htaccess telling the browser to cache the images for a week. That way the visitors only download the images once, which speeds up page load and reduces strain on the server.

Storing images in databases means it will take extra time to load the image as you haev to run a PHP script which then connects to a mysql database which then recives the image and outputs it... ect

Where when saved in a folder the server just serves it and does not proccessing on it.
 
Back
Top