frenchpl Posted April 2, 2010 Share Posted April 2, 2010 I have a table display of eleven columns and multiple rows. I have no problem populating the table or displaying it. I now want one of the eleven columns to be an input column. Such that the user can 'check' this column, for any row of the displayed table. If I am displaying ten rows at a time from the DB, I need the user to be able to 'check' any number from one to all ten, before hitting the submit button and the values being recorded. Any suggestions please? Link to comment https://forums.phpfreaks.com/topic/197351-user-input-during-display/ Share on other sites More sharing options...
Catfish Posted April 2, 2010 Share Posted April 2, 2010 when outputting a record's data in the table, include a line to output the HTML to create the checkbox. while ($rowData = mysql_fetch_assoc($result)) { foreach($rowData as $fieldName => $value) { print($value); // etc outputting your record data } print('<input type="checkbox" name="'.$rowData['idNum'].'"/><br/>'); // $rowData['idNum'] is an example of the record's primary key value } Link to comment https://forums.phpfreaks.com/topic/197351-user-input-during-display/#findComment-1035898 Share on other sites More sharing options...
TeddyKiller Posted April 2, 2010 Share Posted April 2, 2010 when outputting a record's data in the table, include a line to output the HTML to create the checkbox. while ($rowData = mysql_fetch_assoc($result)) { foreach($rowData as $fieldName => $value) { print($value); // etc outputting your record data } print('<input type="checkbox" name="'.$rowData['idNum'].'"/><br/>'); // $rowData['idNum'] is an example of the record's primary key value } When $result is your mysql query to get the data. Link to comment https://forums.phpfreaks.com/topic/197351-user-input-during-display/#findComment-1035901 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.