PHP Shopping Cart Example (1/5) _php Tutorial

Source: Internet
Author: User
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.

PHP Tutorial Shopping Cart Example
Here also provides a PHP shopping cart instance code, this is a suitable for the development of the mall or shopping system reference development examples, tell you if you add merchandise to the shopping and delete, with the shopping cart database tutorial design examples.
Inventory table

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 ');
*/

1 2 3) 4 5

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

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.