What happens in the database, if the user clicks "Buy" a product?

Guys, tell me, write an Internet shop that happens to the database if the user clicks "Buy" a product? Write the sequence.
July 9th 19 at 12:48
3 answers
July 9th 19 at 12:50
Item added to Basket! All database nothing written. Just selected data stored in the cookie for example. To avoid problems, then what man is going to pay, and the goods already bought and it is not available. Then on checkout page you can do this check and print a warning that this product is no longer in the desired quantity.
Thank you - hershel.Klocko commented on July 9th 19 at 12:53
July 9th 19 at 12:52
Adds product to cart
July 9th 19 at 12:54

Find more questions by tags PHP