By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

php query doubt

P: 1
i have two tables in a single database sales... one is product other is order... i want someones help to know how can i do one operation.... i.e

when i click on order i want to subtract that one order from the product table....

can u help me with the query?

ok sure..

Order table

Id int
Product_id text
Dealer text
Quantity int


Id int
Name text
Brand text
Expirydate date
Mfgdate date
Department text
Cost int
Quantity int
Dec 9 '11 #1
Share this Question
Share on Google+
1 Reply

P: 78
Better you write a trigger at back end.
Expand|Select|Wrap|Line Numbers
  1. update product set Quantity=Quantity-new.Quantity where Product.Id=new.Id
Dec 9 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.