A strategy question about using mySQL for saving flat-file stings?

From: Date: Mon, 25 Jul 2005 13:40:42 +0000
Subject: A strategy question about using mySQL for saving flat-file stings?
Groups: php.general 
Request: Send a blank email to php-general+get-219300@lists.php.net to get a copy of this message
I've been creating a number of CM applications for a virtual-host website. One feature, of several applications, allows the editor [one of our people] to create simple text files. I've been using simple flat-files in a directory for saving the files. I've gotten tried of dealing with directory permission problems, etc., and am considering using a simple mySQL DB for storing the file strings. Obviously, for each file-string to be unique, its path must be included as part of the ID. Here is my question. I can use one table for all the path/files and use the following as the primary key "/home/some-dir/filename". fields: fullpath-filename | path | type | date | binary-string path is so the code can do an equivalent of scandir() type signifies whether data has been serialized() or not. This is so I can save arrays date is the equivalent of file last mod date. Or, I can create a separate table for each full-path used and then just use the filename for the primary key. In this case, since the table name is in effect the path, only the filename is needed. The first approach is obviously simplest; but, I'm concerned about getting myself into a trap later on. Anyone offer any suggestions? Many thanks.....

« previous php.general (#219300) next »