Please help!! I have an orders table, a restaurant stock table and a warehouse stock table. I am currently trying to build an inventory management system using PHPmyAdmin and Laravel through the IDE PHPstorm. At present I have a form submitting orders to the orders table, however what I want is that when this order is submitted, the data in the warehouse stock and restaurant stock tables is updated also. For example, Item: Chicken Breast Quantity needed: 6 user presses submit, and order is uploaded to the orders table. They are able to view these orders in a previous orders view. Can someone help with an algorithm to link the three tables together, so that the quantity field is updated each time? (Restaurant stock table eg item Chicken Breast quantity will go up by 6, whilst warehouse goes down by 6)
Don't know laravel, but at the point you process your input of quantity=6 you make your
insert into orders (quantity) values(6);
you do
update stocktable set quantity=quantity-6 where...