0

I'm making a user plateform on my website with php/mysql, and I want to know if is it good to allow users add photos using the mysql blob file, or adding their photos in a folder with their id, and storing every photo's path with a VARCHAR variable into the database. Thanks

Y1NL30
  • 3
  • 2
  • 1
    second option is better than saving file data in blob –  Jul 17 '13 at 22:58
  • 1
    see http://stackoverflow.com/questions/8182315/store-image-files-or-urls-in-mysql-database-which-is-better or http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay or http://stackoverflow.com/questions/2517752/images-in-database-vs-file-system – Sean Jul 17 '13 at 22:59

1 Answers1

1

Always do the following:

  1. rename the image
  2. store it in a folder of your choosing
  3. store the location of the image in a varchar column in your mysql table.

simple and effective.

Smith Smithy
  • 585
  • 6
  • 24