I have 1 table: temp_shoppingcart .
In the temp_shoppingcart, i have temp_shoppingcart_id, user_id, product_id, quantity and color. Anytime, a user add an item in the shopping cart, it will add a new row to store the data.
So the data will have something like user_id: 1, product_id: 123, quantity: 1, color: black. If the user add the same item again, it will have the same data entered as a new row. So there will be the same row twice.
How do I display the data such that the same product will be group together as display as the same row but the quantity is the sum of 2 rows?