I'm working on a small online shopping script in PHP. It's nothing special - just an listing of products and adding to a cart.
I'm preety new to the world of PHP and databases - so please, be gently )
I'm using two tables in one database: "users" (name, surname, address...) and "products" (price, packing...).
All this is working just fine, but i have problems with the cart. I just don't know, how i should add things to it.
I would like to have a table with "orders", with the following data in it: Products ordered (maybe the order ID), timestamp and the user that ordered the shipping.
For that reason i would need another table, something that would work as an "Shopping Cart".
But there's the problem. If i store the Cart_ID, + product 1 + quantity of product 1 + product 2 + quantity of product 2... And so on...
I hope someone understands the problem. Sorry for my bad English - you've propably noticed, English isn't my mother's language
I'm preety new to the world of PHP and databases - so please, be gently )
I'm using two tables in one database: "users" (name, surname, address...) and "products" (price, packing...).
All this is working just fine, but i have problems with the cart. I just don't know, how i should add things to it.
I would like to have a table with "orders", with the following data in it: Products ordered (maybe the order ID), timestamp and the user that ordered the shipping.
For that reason i would need another table, something that would work as an "Shopping Cart".
But there's the problem. If i store the Cart_ID, + product 1 + quantity of product 1 + product 2 + quantity of product 2... And so on...
I hope someone understands the problem. Sorry for my bad English - you've propably noticed, English isn't my mother's language