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

Your name:

Reply:


Posted by Al on 07/25/05 16:40

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.....

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация