Administration

Once the structure of the database has been created, you can make the administration side wherein the store owner can establish products, set prices, and so forth. There's nothing too novel here, but I'll go through the scripts so you can better understand how the database relates to the virtual store and how the whole should be administered.

On account of the structure of the products table—the only one ultimately controlled by the administrator—the proper order is to fill in the product_names, product_sizes, and product_formats tables first, and then define individual products. I'll write one page that adds to these three tables and another that uses them to create a product. A third script will allow for editing an item.

To ...

Get PHP Advanced for the World Wide Web: Visual QuickPro Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.