Creating a Simple Shopping cart
Helloo
Im new in Databases.
I want to create a simple shopping cart i have a table called product
CREATE TABLE `products` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category` varchar(150) NOT NULL,
`name` varchar(100) NOT NULL,
`author` varchar(100) NOT NULL,
`details` varchar(10000) NOT NULL,
`price` int(11) NOT NULL,
`imgpath` varchar(500) NOT NULL,
`dateadded` date NOT NULL,
`stock` int(11) NOT NULL,
PRIMARY KEY (`id`)
)
what i want is when i click the add to cart button the product must add to a cart i don't have a idea how to do this
ruwanaru
Junior Poster in Training
67 posts since Mar 2009
Reputation Points: 10
Solved Threads: 1
Why don't you use the paypal cart cms or if you want it custom made then perhaps download a pre-made cart and see how they did it. But as for how to insert the item simply use the mysql_query("INSERT INTO `table` SET `column`='value', `another`='value2'");
Also you will need to send the user a cookie for identification.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259