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 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.