dprichard Posted June 20, 2007 Share Posted June 20, 2007 I am using a do while loop to run through a list of items on my page. Say I have 5 items on the page and each has one field that the user can input information to. Is there a way to do an update where it will update all records on the page with one submit form? Quote Link to comment https://forums.phpfreaks.com/topic/56356-updating-multiple-items-with-one-form/ Share on other sites More sharing options...
jvrothjr Posted June 20, 2007 Share Posted June 20, 2007 is each field part of the same record within the same table if so yes. Quote Link to comment https://forums.phpfreaks.com/topic/56356-updating-multiple-items-with-one-form/#findComment-278400 Share on other sites More sharing options...
dprichard Posted June 20, 2007 Author Share Posted June 20, 2007 Yes, it is a list of folders and each line has a form field with the ID CategoryOrder. I want the user to be able to change several CateogryOrder if they want and then submit the form once. That is the only field they will be updating. Quote Link to comment https://forums.phpfreaks.com/topic/56356-updating-multiple-items-with-one-form/#findComment-278402 Share on other sites More sharing options...
dprichard Posted June 20, 2007 Author Share Posted June 20, 2007 Okay, I found this article that I think is pointing me in the right direction. http://lists.nyphp.org/pipermail/front-end/2004-February/000196.html I see that he has the input type listed with [id1], [id2], [id3], etc. Can someone point me to an article or assist me with how to do the bracketed number that increases for the name of each CategoryOrder form element? Here is my current HTML <?php do { ?> <tr> <td width="10" class="list_item_boxleft"><table width="1" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="icon_box"><input type="hidden" name="CategoryID" id="CategoryID" value="<?php echo $row_categories['CategoryID']; ?>"> <input name="submit" type="image" src="/images/cabinet.png" alt="View items in this category" width="16" height="16"> </td> </tr> </table></td> <td class="list_item_box_highlightedleft"><?php echo $row_categories['CategoryName']; ?></td> <td class="list_item_box"><?php echo $row_categories['CategoryDescription']; ?></td> <td class="list_item_box"><?php echo $row_categories['CatCreatorName']; ?></td> <td class="list_item_box"><?php echo $row_categories['doc_cat_status_name']; ?></td> <td width="3" class="list_item_box"><label> <input name="CategoryOrder" type="text" id="CategoryOrder" size="3" maxlength="3" value="<?php echo $row_categories['CategoryOrder']; ?>"> </label></td> <td class="list_item_boxright"> </td> </tr> <?php } while ($row_categories = mysql_fetch_array($categories)); ?> Quote Link to comment https://forums.phpfreaks.com/topic/56356-updating-multiple-items-with-one-form/#findComment-278413 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.