Codice PHP:
$itemQty = $_POST['txtQty'];
$prezzo = $_POST['prezzo'];
$sconto = $_POST['sconto'];
$numItem = count($itemQty);
$numItem1 = count($prezzo);
$numItem2 = count($sconto);
$numDeleted = 0;
$notice = '';
for ($i = 0, $numItem1, $numItem2; $i < $numItem; $i++) {
$newQty = (int)$itemQty[$i];
$newQty1 = (int)$prezzo[$i];
$newQty2 = (int)$sconto[$i];
if ($newQty < 1) {
// remove this item from shopping cart
deleteFromCart($cartId[$i]);
$numDeleted += 1;
} else {
// update product quantity
$sql = "UPDATE tbl_cart
SET ct_qty = $newQty,
ct_price = $newQty1,
ct_sconto = $newQty2
WHERE ct_id = {$cartId[$i]}";
dbQuery($sql);
}
}
ok, funziona!
grazie