1

Possible Duplicate:
Storing Images in DB - Yea or Nay?

Is uploading a picture and storing it in the database a good way to keep track of avatars Or is there a better solution when people are uploading a picture.

working with jquery php and mysql

I don't have experience in this so how would I go about it?

thinadv, Richard

Community
  • 1
  • 1
Richard
  • 4,516
  • 11
  • 60
  • 87
  • This question is extremely open ended. You should probably try some things experiment and then come back with a more specific question – austinbv Sep 01 '11 at 17:26
  • 2
    Generally, store the file in the file system, and store its path/URL in the database. You usually don't want the actual files in the DB. – ceejayoz Sep 01 '11 at 17:26
  • 1
    Related http://stackoverflow.com/questions/7237451/storing-binaries-in-database-do-i-miss-some-drawbacks-in-this-particular-situati/ – Claudio Sep 01 '11 at 17:27
  • This is a DUP of this: http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay. – Icarus Sep 01 '11 at 17:30
  • yes, this is a lazy question. I acknowledge that I could have searched before I posted it – Richard Sep 01 '11 at 19:33

1 Answers1

2

If you want to store files in the db you would use a BLOB, they have their up's and downs. Otherwise you would store a path and populate the src attribute of the image tag with the path from the db.

austinbv
  • 9,297
  • 6
  • 50
  • 82
  • thanks Austinbv I think I will try to store the path, that seems the most logical. I have a problem with being to generic today. – Richard Sep 01 '11 at 17:36