zac1987 Posted February 12, 2009 Share Posted February 12, 2009 $checkbox_value=$_POST["selectlist"]; for($i=0;$i<1;$i++){ $query1 = "SELECT * FROM shoping_cart where reserve_id = {$checkbox_value[$i]} "; $result1 = mysql_query($query1,$connection) or die (mysql_error()); confirm_query($result1); while($cart_list = mysql_fetch_array($result1)){ $item = $cart_list['item']; $updated_available_quantity = $cart_list['available_quantity'] + $cart_list['quantity']; echo $updated_available_quantity . "-" . $item. "<br />"; echo $cart_list['available_quantity'] . "<br /><br />"; } The output: 89-Man Wig 88 94-Man Wig 88 My Problem how to make the output like below? 89-Man Wig 88 95-Man Wig 89 Quote Link to comment Share on other sites More sharing options...
gevans Posted February 12, 2009 Share Posted February 12, 2009 there's your problem right there, your keyboards broken Quote Link to comment Share on other sites More sharing options...
zac1987 Posted February 15, 2009 Author Share Posted February 15, 2009 $query4 = "SELECT * FROM shoping_cart where id = {$checkbox_value[$i]}" $result4 = mysql_query($query4); while($cart_list = mysql_fetch_array($result4)){ $total_quantity = $total_quantity - $cart_list['quantity']; $updated_available_quantity = $cart_list['available_quantity'] - $total_quantity; let say check box has select 2 items - (two lists of wig and 1 list of pendrive) $total_quantity will add up all the 3 lists quantity. How to make the $total_quantity add up the quantity of wig and pendrive seperately? Quote Link to comment Share on other sites More sharing options...
zac1987 Posted February 16, 2009 Author Share Posted February 16, 2009 Problem is solved. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.