[...] save all of the user's information to a text or XML file. Then, use php fread/fwrite to adjust the file as users are added or edited. This requires a lot of creative thought, but I find it easier than writing to a database.
While it's conceptually easier ("a file is a sequence of characters, and has a read/write position" is simpler than the RDB model), it's harder to implement. When you use a database, you
get a number of features for free that you otherwise need to implement when using flat files.
XML is a whole new game. As long as you don't write your own XML handler, you get the ease of use and some of the features of a database, though the performance suffers. For this reason, XML is best suited for transfering partial datasets rather than storing large amounts of data. Add in a database management system that uses indices and a binary XML format and you're just about golden, but at that point you need a
DDL and
DML, so there's not a significant advantage over using MyQSL/MSSQL/PostrgeSQL in terms of simplicity of use.
SQL, by the way, has a hidden simplicity. You have some basic (aka atomic or scalar) types and two aggregate types: rows (collections/tuples of scalars) and tables (collections/lists of rows). DML statements map tables to tables. They support the following operations on tables:
- join tables to create a new one using the JOIN clause,
- remove columns (aka "projection") by listing columns after SELECT,
- filter rows using the WHERE and LIMIT clauses
- map a group of rows to a single row using the GROUP BY clause and aggregate functions,
- sort rows,
- perform set operations (union, intersection, difference) on tables,
- add rows to/change rows in tables via the INSERT and UPDATE statements
There are details (such as NULL values) this doesn't cover, but that's the gist. Database design, by contrast, can be a more complex topic, though SQL's DDL is simpler than its DML.