Monday, July 6, 2009

Saving Data for Later

There are basically two ways you can store data: in flat files or in a database.
A flat file can have many formats but, in general, when we refer to a flat file, we mean a
simple text file. In this example, we’ll write customer orders to a text file, one order per
line.
52 Chapter 2 Storing and Retrieving Data
This is very simple to do, but also pretty limiting, as we’ll see later in this chapter. If
you’re dealing with information of any reasonable volume, you’ll probably want to use a
database instead. However, flat files have their uses and there are some situations when
you’ll need to know how to use them.
Writing to and reading from files in PHP is virtually identical to the way it’s done in
C. If you’ve done any C programming or UNIX shell scripting, this will all seem pretty
familiar to you.

No comments:

Post a Comment