emmavt Posted August 12, 2007 Share Posted August 12, 2007 I have a products table that I have created from a query, but I need to update the information based on quatity. What I am confused about is how to pass the multiple values to another page when they have the same variable names. here is my table: echo "<table width='100' border='1'><form>"; echo "<tr><th>Product ID</th><th>Name</th><th>Price</th><th>Quantity</th><th>Total Price</th></tr>"; $count=0; while($row2=mysql_fetch_assoc($result2)){ //grabbing results from the query $id=$row2['id']; $productid=$row2['productid']; $name=$row2['name']; $price=$row2['price']; $quantity=$row2['quantity']; $totalprice=$price * $quantity; $count++; echo "<tr><td>$productid</td> <td>$name</td> <td>$price</td> <td>$quantity</td> <td>$totalprice</td></tr>" ; } //end table for db results echo "</form></table>"; Any help wouyld be greatly appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/64554-passing-multiple-table-values/ Share on other sites More sharing options...
hitman6003 Posted August 12, 2007 Share Posted August 12, 2007 You can create sub arrays of $_POST and $_GET using the array brackets on the end of your variable names... <input type="checkbox" name="checkboxes[]" value="value1"> Value1 <input type="checkbox" name="checkboxes[]" value="value2"> Value2 <input type="checkbox" name="checkboxes[]" value="value3"> Value3 <input type="checkbox" name="checkboxes[]" value="value4"> Value4 Which will result in $_POST['checkboxes'] being an array that has values equal to the checked boxes. Quote Link to comment https://forums.phpfreaks.com/topic/64554-passing-multiple-table-values/#findComment-321799 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.