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
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- 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...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: