I have built an E commerce website that handles everything apart from inventory. (Stock Control)
I am using PayPal Express Checkout for my payment gateway, so the payment is processed on my website.
The problem is deducting the quantity purchased from the stock value in the database.
I want to do this via a simple loop. However I just cannot make it work.
<?php
while (!$eCart->EOF()) {
mysql_select_db($database_ecart2, $products);
$query_itemQ = "Update Products SET Products.ProductStock = Products.ProductStock -
$DetailQuantity WHERE Products.ProductID = $idCall";
$itemQ = mysql_query($query_itemQ, $products) or die(mysql_error());
$eCart->MoveNext();
}
$eCart->MoveFirst();
?>Hope someone can help...
Help














