Home arrow PHP arrow Page 4 - Building an E-Commerce Site Part 1: Building a Product Catalog

Step 1: Creating the Database - PHP

This is the first article in a three-part series dealing with using PHP 4 and MySQL to make a comprehensive e-commerce storefront solution. This article covers the product catalog database design and creating the catalog administration interface.

TABLE OF CONTENTS:
  1. Building an E-Commerce Site Part 1: Building a Product Catalog
  2. Assumptions and Requirements
  3. Overview of a Simplified E-Commerce System
  4. Step 1: Creating the Database
  5. Step 2: Creating the Product Catalog
  6. Step 3: Populating the Tables with Data
  7. Step 4: Creating Catalog Maintenance Screens
  8. Step 5: Putting It All Together
By: Ying Zhang
Rating: starstarstarstarstar / 129
April 25, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

We will create a database called mymarket and then a user account called myuser with the password mypassword. Fire up MySQL and login as the root user by issuing this command from the shell prompt:


$ mysql -u root -p
You should see MySQL started:

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 412 to server version: 3.22.30 Type 'help' for help. mysql>

From here, issue the following commands:

mysql> CREATE DATABASE mymarket;
This creates a database called mymarket. Now let's create the myuser account and specify the privileges that he has in the mymarket database. Issue this command:

mysql> GRANT select, insert, update, delete -> ON mymarket.* TO myuser@localhost IDENTIFIED BY 'mypassword';

This will add an entry into the appropriate MySQL security tables that tell MySQL to create a user called myuser who uses the password mypassword. myuser can only connect from localhost, and once properly authenticated will be able to issue SELECT, INSERT, UPDATE and DELETE queries on all the tables in the mymarket database (mymarket.*).

Next we have to make mymarket the current database:

mysql> USE mymarket;


 
 
>>> More PHP Articles          >>> More By Ying Zhang
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap

Dev Shed Tutorial Topics: