0

I would like to know what is the the best way to store the information given by the user. Say the customer has entered 'n' number of lines.

Which one is the best way to store the text, either to the DB or to the file. Also which is the best way to retrive using PHP.

Thanks, Lokesh.

Lokesh
  • 829
  • 2
  • 14
  • 26
  • *Structured* data is best stored in a relational database. If you just receive blobs of text, then a simple 1:1-file store becomes sensible. – mario Oct 10 '11 at 17:08
  • possible duplicate of [What are the pros and cons of storing files in a database?](http://stackoverflow.com/questions/2458739/what-are-the-pros-and-cons-of-storing-files-in-a-database) – mario Oct 10 '11 at 17:09

2 Answers2

1

Using a database is the best way. It is secure. Retrieving and storing are easy.

Mob
  • 10,958
  • 6
  • 41
  • 58
1

Your question is dependent on many variables and is a bit objective. However, I find that saving to a database is better for maintainability. Although you can search, filter, etc. from a file - it's a bit more native and simpler through a DB api.

swatkins
  • 13,530
  • 4
  • 46
  • 78