Thanks Justin and Khashan for all your help. Managed to resolve the issue. I named qty field using the albumId as key and using qty as value. All I had to do then was update the query in the while loop. "Kaizer Boab" <kaizer_boab@xxxxxxxxxxx> wrote in message news:20040402175521.502.qmail@xxxxxxxxxxxxxxx > Hi everybody, > > I have built a shopping cart using tables. I am able to add items and remove > items from the cart. The problem I am having is updating the quantities in > the cart. > > When users view the cart they can see the quantity in a text field. I want > to allow users to type in the quantities they want in this box and then > submit the form to display the new quantities. > > The problem is when the form is submitted only one of the quantity fields is > updated, the others remain unchanged. I have tried to use a while loop to > make it update all the quantities but it doesn't seem to work. Below is the > script I am using to UPDATE the quantites. Can anyone help me? > > Thanx in advance. > > > <?php > $trackerId = $HTTP_POST_VARS['trackerId']; > $albumId = $HTTP_POST_VARS['albumId']; > $qty = $HTTP_POST_VARS['qty']; > > mysql_select_db($database_con_ayrsrock, $con_ayrsrock); > > $queryQty= "SELECT qty FROM cart WHERE trackerId = $trackerId AND albumId = > $albumId"; > $rsQty = mysql_query($queryQty); > > while ($row_rsQty = mysql_fetch_array($rsQty)) > { > $newQty = $qty; > mysql_query("update cart set qty = $newQty where trackerId = $trackerId and > albumId = $albumId"); > } > ; ?> -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php