Preach Wisdom Podcast Hanshunping php video Tutorial notes zend.framework. 15th. Integrated Application-Shopping cart 1
Zend.framework. 15th. Integrated Application-Shopping cart 1
My Shopping cart function module, demand analysis.
A landing system
b Browse products, pagination
C Add the item to the shopping cart and curd the shopping cart.
D Place Order
e email, notify each other, use Phpmail
Interface
Design Database
--User table
CREATE TABLE Users
(
ID int PRIMARY KEY,
Name varchar (+) NOT null default ' ',
PWD char (+) NOT null default ' ',
Email varchar (+) NOT null default ' ',
Tel varchar (+) NOT null default ' ',
Grade tinyint unsigned NOT NULL default 1
)
Insert into users values (100, ' Andy Lau ', MD5 (123456), [email protected]. com ', ' 1394343432 ', 1);
Insert into users values (101, ' Jacky ', MD5 (123456), [email protected]q.com ', ' 1394343472 ', 1);
MD5 check, save character is 32 bits. Fixed length, so use char
--Commodity table (Product category table-level two level three level)
CREATE TABLE book
(
ID int primary KEY auto_increment,
Name varchar (+) NOT null default ' ',
Author varchar (+) NOT null default ' ',
Publishhouse varchar (+) NOT null default ' ',
Price float is not null default 0,
Nums int NOT NULL default 10
)
--Shopping Cart table
CREATE TABLE Mycart
(
ID int primary KEY auto_increment,
UserID int,
BookID int,
nums int unsigned,
cardate int unsigned,
FOREIGN KEY (userid) references users (ID),
Foreign KEY (BookID) references book (ID)
)
--order form (usually designed as 2 tables, 1 called main tables, 1 Order Details table)
Use a frame chart to design our website and related files and call relationships.