i need advice on the most efficient way of accomplishing this: 1. query data from a database table 2. depending on the number of records found, display all records to the user 3. at the end of each record displayed, add a checkbox 4. at the end of the entire page, include a submit button 5. the 'action' of the form/submit button is another php page 6. the user can select multiple rows from the display and click the submit buton 7. at the action php page, i need to know which checkboxes are selected the challenge here is that in the display page, the number of records is dynamic. any advice at all would be much appreciated. thanks for your time!
More or less you need something link this in the "first" page: echo '<form action="second_page.php" method="post">'; echo '<table>'; $query = 'SELECT * FROM table'; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { echo '<tr>'; echo '<td>' . $row['field1'] . '</td>'; echo '<td>' . $row['field2'] . '</td>'; echo '<td><input type="checkbox" name="checkboxes[]" value="' . $row['id'] . '"></td>'; echo '</tr>'; } echo '<tr><td colspan="3" align="center"><input type="submit" value="Submit this form"></td></tr>'; echo '</table>'; PHP: and in the "second_page.php" you would have an array called "checkboxes" in $_POST: print_r($_POST); PHP: HTH, cheers!