Creating the Database

The e-commerce site in this example will use the simply named ecommerce database, created in Chapter 8, “Security.” Here, I’ll explain the structure of the database as a whole and create the required tables.

The ecommerce database will contain four tables: two for managing the products being sold, one for the customers, and another for the orders. The artists table (Table 13.1) stores the information for the artists whose work is being sold. It contains a minimum of information, but you could easily add birth and death dates, biographical data, and so forth.

Table 13.1. The artists table will be used to link artist names to each individual print (see Table 13.2).
The artists Table
COLUMNTYPE
artist_idINT(3)
first_nameVARCHAR(20) ...

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide 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.