This topic is locked

Inventory System

10/25/2005 6:07:40 AM
PHPRunner General questions
author

Hi all,
Firstly, great software. In 10 minutes I have set up a customer database, which hard coded would have taken days.

I am now setting up an orders database. My issue is that I have a products table which contains products and no. in stock. I have an orders table which is the master of an orders details table. I want to be able to update the stock level in products when that specific product has been ordered from the order details page.
i.e. user orders 2 cartons of juice at order details page

no of juice in the products table updates from 20 to 18
Thanks in advance
Peter

Sergey Kornilov admin 10/27/2005

Peter,
I suppose the best way to implement this is to use database triggers.
Putting the code to update product stock levels to PHP pages is quite complex and very unreliable.