views:

267

answers:

1

I have a simple HTML table display of data that results from an MySQL query. I would like to have a checkbox in the first cell of each row.

I am asking for some suggestions as to where I might go looking for information on how to make this interactivity possible, as I'm sure this is not a "quick-answer" type of question.

Example: http://linux.softpedia.com/screenshots/phpMyAdmin_2.png

Thanks!

+1  A: 
<input type="checkbox" name="rowid[]" value="<?= $row['id'] ?>" />
Ignacio Vazquez-Abrams
Thank you, Ignacio. None of my books, so far as I can tell, have an example of this. Would your code go directly into a cell in the HTML table, or would I need to re-do the whole query output as a form?
dave
Both. The table would be embedded in a form. Iterate through the rows using the appropriate element for the value, and then on the flipside look at `$_POST['rowid']` in order to get the selected IDs.
Ignacio Vazquez-Abrams
OK, I'll give it a try. Thanks again!
dave