$ID = $_GET['ID'];
$cart = $_SESSION['cart'];
foreach ($cart as $row) {
if($row['ItemID'] == $ID){
$QntyC = $_GET['Qnty'];
$Qnty = $row['Qnty'];
if ($QntyC == 'Min') {
$Qnty = $row['Qnty'] - 1;
} else {
$Qnty = $row['Qnty'] + 1;
}
$_SESSION['cart'][] = array('ItemID' => $ID, 'Name' => $row['Name'], 'Qnty' => $Qnty, 'Size' => $row['Size'], 'Color' => $row['Color'], 'NZD' => $row['NZD']);
}
}
I want this to update the Qnty but it adds a new row.... does the basic forumla okay