SQL Update command
-
hi, I cannot get this SQL command to work in MySQL, its supposed to update the product quantity with how many has been ordered by the customer UPDATE Products SET ProdQuantity = (ProdQuantity - s.Quantity) FROM Products p, ShoppingCart s WHERE p.ProductID =(SELECT ProductID FROM ShoppingCart WHERE ProductID = p.ProductID and s.CartID='" + Convert.ToString(cartID) + "')") Im not sure what im doing wrong, anyone have any ideas? Thanks in advance Jetset
-
hi, I cannot get this SQL command to work in MySQL, its supposed to update the product quantity with how many has been ordered by the customer UPDATE Products SET ProdQuantity = (ProdQuantity - s.Quantity) FROM Products p, ShoppingCart s WHERE p.ProductID =(SELECT ProductID FROM ShoppingCart WHERE ProductID = p.ProductID and s.CartID='" + Convert.ToString(cartID) + "')") Im not sure what im doing wrong, anyone have any ideas? Thanks in advance Jetset