Hello, I've created an invoicing system for my bookstore where everything is working fine. If the invoice includes 3 books it'll update the stock for the book1, book2 and book3 but the problem is when someone cancel an invoice i have a problem fixing the stock back to normal. I've created a sql and a delete query but it only updates the 1st book to the quantity of all the books here's an eg:
invoice1:
book1-> quantity: 2 -> price: $5
book2-> quantity: 1 ....
book3-> quantity: 3 ...
and in the stock table i have:
book1 -> stock: 40
book2 -> stock: 30
book3 -> stock: 20
when i run the query it only updates the book1 to 46 (but i get themsg: you are about to update 3 rows...)
any idea how to solve this issue? thnx
invoice1:
book1-> quantity: 2 -> price: $5
book2-> quantity: 1 ....
book3-> quantity: 3 ...
and in the stock table i have:
book1 -> stock: 40
book2 -> stock: 30
book3 -> stock: 20
when i run the query it only updates the book1 to 46 (but i get themsg: you are about to update 3 rows...)
any idea how to solve this issue? thnx