The shopping cart uses the server-side language PHP and a MySQL database. Some of the code can be confusing to understand but if you look at it carefully it can be under stood. I have never coded in PHP before but I can kind of understand this segment of code setting up the database
CREATE TABLE books (
id int(6) unsigned NOT NULL auto_increment,
title varchar(100) NOT NULL default '',
author varchar(100) NOT NULL default '',
price decimal(3,2) NOT NULL default '0.00',
PRIMARY KEY (id)
) TYPE=MyISAM;
The id will be an integer with the maximum of 1 million books. I think the varchar(100) give the title and the author a 100 character maximum. The price decimal(3,2) makes the price a decimal with 2 decimal places and the maximum be $999.
This shopping cart will also give you a running total of the price and of how many items are in the shopping cart. It show you how to remove, update and add more items to your shopping cart.
No comments:
Post a Comment