I have 3 tables:
- Products containing IDProduct, IDCategory, Name
- Suppliers containing IDSupplier, SupplierName, Phone
- ProductSupplier containing IDProduct, IDSupplier, Price, Quantity
I want to update (edit) the following: IDCategory, Name(product), IDSupplier, Price, Quantity, but i'm not doing the UPDATE query right:
$query="UPDATE products P,
category C,
suppliers S,
productsupplier PS
SET P.IDCategory = '$idcategory',
P.Name = '$Name',
S.IDSupplier = '$idsupplier',
PS.Price = '$Price',
PS.Quantity = '$Quantity'
WHERE ((IDProduct = '$idproduct')
AND (P.IDProdus = PF.IDProdus)
AND (PS.IDSupplier = S.IDSupplier )
AND (P.IDCategory = C.IDCategory))");
How do i do this right? Thank you!
PF.IDProdusshouldn't it bePS.IDProdus? there is no PF table