[thelist] Alternate sources of storing data?
Joel D Canfield
joel at streamliine.com
Mon Oct 8 11:48:51 CDT 2007
> It seems like a lot of work to build a database interface for
> something this
> simple. Any suggestions on how to work this out with a flat
> file, whether it
> be an xml file or json or whatever? Basically I'd like to be
> able to simply
> open joe_blow.txt, add a line and be done.
It matters a lot whether the data will ever have to be sorted or
aggregated. If not, if it's really just a buncha text. I'm fairly sure
PHP has read from/write to text file abilities similar to VBScript's
(which is what I know.) http://us2.php.net/file might be a starting
place.
>From a conceptual rather than syntactical perspective: I've had a web
form gather data (or a database query return results) and then create
and open a text file for writing or appending, using different functions
for writing a bunch of text or a single line of text. Close the file and
you're done.
Reading it back is just a matter of reading the contents into a
variable, then display it.
I don't know XML as well as I should and I've never met this Json guy,
but if you'll ever have need to sort, filter, or aggregate, I'd just put
it in a database. My primary use for text files has been creating comma
separated value files for delivery to Excel users.
joel
More information about the thelist
mailing list