PHP Shopping Cart Example here also provides a PHP shopping cart instance code, which is suitable for the development of the mall or shopping system reference development examples, tell you if you add merchandise to the shopping and delete, and shopping cart database design instance.
CREATE TABLE Inventory (
Product Tinytext NOT NULL,
Quantity Tinytext NOT NULL,
ID int (4) Default ' 0 ' NOT NULL auto_increment,
Description Tinytext NOT NULL,
Price Float (10,2) The default ' 0.00 ' NOT NULL,
Category char (1) default ' NOT NULL,
Key ID (ID),
Primary key (ID),
Key Price
);
INSERT into inventory values (' HDD ', ' 5 ', ' 1 ', ' 80g ', ' 5600 ', ' 1 ');
INSERT into inventory values (' CPU ', ' n ', ' 2 ', ' p4-2.4g ', ' 6600 ', ' 1 ');
INSERT into inventory values (' DVD-ROM ', ' 7 ', ' 3 ', ' 12x ', ' 2000 ', ' 1 ');
INSERT into inventory values (' motherboard ', ' 3 ', ' 4 ', ' asus ', ' 5000 ', ' 2 ');
INSERT into inventory values (' show card ', ' 6 ', ' 5 ', ' 64m ', ' 4500 ', ' 1 ');
INSERT into inventory values (' burner ', ' 4 ', ' 6 ', ' 52w ', ' 3000 ', ' 1 ');
Shoping table
CREATE TABLE Shopping (
Session Tinytext NOT NULL,
Product Tinytext NOT NULL,
Quantity Tinytext NOT NULL,
Card Tinytext NOT NULL,
ID int (4) Default ' 0 ' NOT NULL auto_increment,
Key ID (ID),
Primary KEY (ID)
);
Shoper table
Create DATABASE Shopper;
Use shopper;
CREATE TABLE Shopping (
Session Tinytext NOT NULL,
Product Tinytext NOT NULL,
Quantity Tinytext NOT NULL,
Card Tinytext NOT NULL,
ID int (4) Default ' 0 ' NOT NULL auto_increment,
Key ID (ID),
Primary KEY (ID)
);
CREATE TABLE Inventory (
Product Tinytext NOT NULL,
Quantity Tinytext NOT NULL,
ID int (4) Default ' 0 ' NOT NULL auto_increment,
Description Tinytext NOT NULL,
Price Float (10,2) The default ' 0.00 ' NOT NULL,
Category char (1) default ' NOT NULL,
Key ID (ID),
Primary key (ID),
Key Price
);
INSERT into inventory values (' HDD ', ' 5 ', ' 1 ', ' 80g ', ' 5600 ', ' 1 ');
INSERT into inventory values (' CPU ', ' n ', ' 2 ', ' p4-2.4g ', ' 6600 ', ' 1 ');
INSERT into inventory values (' DVD-ROM ', ' 7 ', ' 3 ', ' 12x ', ' 2000 ', ' 1 ');
INSERT into inventory values (' motherboard ', ' 3 ', ' 4 ', ' asus ', ' 5000 ', ' 2 ');
INSERT into inventory values (' show card ', ' 6 ', ' 5 ', ' 64m ', ' 4500 ', ' 1 ');
INSERT into inventory values (' burner ', ' 4 ', ' 6 ', ' 52w ', ' 3000 ', ' 1 ');
*/
http://www.bkjia.com/PHPjc/444859.html www.bkjia.com true http://www.bkjia.com/PHPjc/444859.html techarticle PHP Shopping Cart Example here also provides a PHP shopping cart instance code, which is suitable for the development of the mall or shopping system reference development examples, tell you if you add goods to the shopping ...