NathanS Posted March 5, 2008 Share Posted March 5, 2008 Hi guys, Tearing my hair out over this one! Currently returning a list from a database of customers, via an array. It displays without a problem - what I need to be able to do, is add a checkbox by each one, so someone can tick it and click submit, and it'll update the database for that record. How would I go about linking it in with the ID so that this would be possible? Any help on this would be greatly appreciated! Thanks, Nathan. Link to comment https://forums.phpfreaks.com/topic/94483-check-boxes-with-php/ Share on other sites More sharing options...
able Posted March 5, 2008 Share Posted March 5, 2008 set the html element name to ids[] set the value for each box to the id You'll then get an array $_POST['ids'] that contains the id's of all checked which you can use. Link to comment https://forums.phpfreaks.com/topic/94483-check-boxes-with-php/#findComment-483839 Share on other sites More sharing options...
NathanS Posted March 5, 2008 Author Share Posted March 5, 2008 Still stuck on exactly how to achieve this: this is what I have now: first page: echo "<TD WIDTH=70>"; echo "<font color='#FF6633'>"; echo "<INPUT TYPE='checkbox' ID='NEWID[]' VALUE='$id'>"; echo "</TD>"; echo "</font>"; update page: $sql = "UPDATE customer_insured_party SET ACTIONEDYN = '".$_POST["ACTIONEDYN"]."' WHERE cip_id = '".$_POST["NEWID"]."'"; Am i missing something major? Thanks. Link to comment https://forums.phpfreaks.com/topic/94483-check-boxes-with-php/#findComment-483931 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.