Choosing Your Column Types

Before you start working with SQL and MySQL, you have to identify your application’s needs. This then dictates the database design. For the examples in this chapter, I’ll create a database (generically called sitename) that stores some user registration information (which will then be incorporated into Chapter 7). The database will consist of a single table, users, that contains columns to store user ID, first name, last name, email address, password, and registration date. Table 4.1 shows the current layout, using MySQL’s naming rules for column titles (alphanumeric names, plus the underscore, with no spaces).

Table 4.1. The users table will have these six columns, to store records like the sample data here.
users ...

Get PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.