I need to update the product quantity in the product table according to the quantity which the customers ordered...Since I am new to this field I dont know how to do it with a query.

This is what I want to do in more details.As the administrator checks for new order ,he may accept selected orders from the list.I want to update the product quantity according to that orders which the administrator accepted...

Can someone help me to do this??

Thanks alot

7 Years
Discussion Span
Last Post by sami.asanga

You need something like that:

update products set quantity = quantity - quvalue_from_admin_list 
  where id_quantity = idvalue_from_admin_list

Obviously, in PHP code from your other posting you also need to replace INSERT by above UPDATE ...

-- tesu


Can you please give me the query..:)

I want to update multiple products in product table according to the check boxes which the administrator select..I think need to take the SUM quantity from the ordered items which is ORDER BY quantity..Isn't it??

I dont know how to write the query

If you dont mind post me a query here..Great Help..Thanks alot

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.