I ve problem with this codes.Im working with php & mySQL to build system inventory.So, i want it to be like this.When we sale product,it will reduce the amount that we store in stock record automatically.So, the record in stock record will always be updated automatically.So, we will know the quantity of stock in stock record.Pls help me dude!!!!May be you have another example or can help me to modify this codes.It cannot run,and gives error.