From my usage of text files, although I often read text file (both txt and htm) I seem to never write to text files. I suppose MySQL has always been a better alternative especially since it is not garranteed that the data you write will be actually written to the text file. I learnt that when doing a loop that would append to a text file 10000 times and a few dozen would never be recorded.
So in my opinion, use databases if you can especially since they are password protected. Only use text files if you want computer generated html files or something like that.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
My circumstance
a number of files, changed at midnight then remain the same for 24 hours.
first access after midnight script generates the files from database,
then they are served from the file system,
very basic cache system to reduce database calls.
Read files
a supplier changes their price lists, we receive .csv to parse and import to sql database, weekly(?)
there are 20K stock items in some supplier lists,
typing would take longer than the time between updates
almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
I almost never write to txt, unless producing dynamic xml/xspf files, and even then the data is stored in db, filtered and then written. One other time is when I need static files (produced from my own cms) - but there may be better ways to do this. As mentioned, txt files can't be protected v. easily, although caching info is a good reason to use them (phpBB uses a mix of db info and cached files) - if the cached info isn't available, it makes a db call. Templating makes use of cached files (e.g. Smarty).
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080