Hi i am currently developing a shopping cart for one of my websites and im having a problem when updating the quantity of an item. I don't have a problem when I only have 1 item in the shopping cart, the problem is when there is more than 1 item in the shopping cart and there quantity are both changed. I have a function which is shown below:
function modify_quantity($table, $session, $product, $quantity) {
$query = "UPDATE $table SET quantity='$quantity' WHERE session='$session' ";
$query .= "AND product='$product' ";
mysql_query($query);
}
This function is called whenever the update button of my shopping cart is pressed if however there is more than 1 item in the shopping cart only the first item is updated.
I have used other shopping cart systems and have noticed that when all the quantities are changed they are updated at the same time. Would a while or a do while statment sort this problem or am i doing this completly wrong.
This shopping cart is one i have created with help from a tutorial i found. Thanks in advance bezatkinson