0
[SOLVED] Anyone can help me in php,html and mysql?
How can i delete all the item's from database of my shopping cart getting all the id store there using php and mysql? I clicked on one item its taking it's id and storing in cart with their name and price.How can i delete all item's when i click on buy in cart?the items will remove from database table permanently as it already bought
11 Respostas
+ 4
What problem you are facing?
+ 1
Hello Christina Jessy
Please give more details about your problem so that we can help you.
+ 1
Yes I am
0
How can i delete all the item's from database of my shopping cart getting all the id store there using php and mysql?
I clicked on one item its taking it's id and storing in cart with their name and price.How can i delete all item's when i click on buy in cart?the items will remove from database table permanently as it already bought
0
Maybe this tutorial helps you:
https://www.tutorialrepublic.com/php-tutorial/php-mysql-delete-query.php
0
Denise Roßberg i can't get the ids from the cart.i want to get all the id of the items of the cart
0
Christina Jessy, If I right understood your question, you need:
1) 4 tables: products, customers, cart_items, orders
2) As you said: "I clicked on one item its taking it's id and storing in cart with their name and price." - if you store item by name instead product id, it is a bad idea. Name and original price can retrieve from the products table using id
3) So, when customer presses "Add to cart" button, need to store new cart item, using customer_id and product_id (and additional data, if need, e.g. qty, options)
4) When customer enters the cart and presses "Place order", then you can add new order and simple delete all cart_items by customer_id
0
Hello World Thank you for helping
0
Hello World but i want that my items will delete too from database when i click checkout.for that i need multiple id.how can i get it?
0
Christina, what items and table do you mean? N.4 of the previous answer describes how to remove multiple quote items.