0

I would like to make a script that adds news in a database, but every newsitem needs an image. But I don't know how I have to do the part with the images, do I have to add them also in the database or is their another way to do it? And what's the best way?

Cheers

2 Answers2

1

You should store path to the image and use it in code that actually loads the file by the path, specified in the DB.

Also: http://www.kirupa.com/forum/showthread.php?323567-How-to-save-image-in-folder-and-path-to-database - look over here. It is the second link in google, by the way.. you better started by looking this up over there.

Storing Images in DB - Yea or Nay? - searching stack... :)

Community
  • 1
  • 1
user
  • 3,058
  • 23
  • 45
  • Oke thanks, so I always have to it with the database? – user1211376 Oct 31 '12 at 09:30
  • When you have to store a big file, you could actually use a BLOB, but that is NOT a good solution. Use the file path and write services that work over it. Just create a File with the path from DB. – user Oct 31 '12 at 09:31
0

There're 2 ways 1- Store Image in Database. 2- Store Image's file path in Database

Đức Bùi
  • 517
  • 1
  • 6
  • 22