Subtracting stock quantity for more than 1 item
I'm successfully deleting an eCart's quantity from the field LampInventory on my checkout_success.php based on dlovas275157 solution:
$FinalStack = $eCart1->DisplayInfo("subtractions");
$idProduct = $eCart1->DisplayInfo("ID");
mysql_select_db($database_connChan, $connChan);
$subtractions = mysql_query("UPDATE Lamps SET LampInventory = '$FinalStack' WHERE LampID = '$idProduct'") or die(mysql_error());
How can I make it work for more than just the first item in the cart. Do I need to create an array or loop? If so any examples please.
Thanks