View Single Post
Old 02-01-2010, 05:40 AM   #1 (permalink)
Dave
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default Checkboxes and db rows

Hello again.

I have a query that pulls rows from a mysql db. The data is displayed in a simple HTML table. The first column of the HTML table has a checkbox for each row. It looks a little like this:


PHP Code:
+-----------+----------+----------+
|   
SELECT  |    NAME  |    ID    |
+-----------+----------+----------+
|   [
ckbx]  |    John  |    2233  |
+-----------+----------+----------+
|   [
ckbx]  |    Susie |    5577  |
+-----------+----------+----------+

SUBMIT 

The user is allowed to select rows, each of which has a unique ID. I have spent untold hours trying to understand how to know which rows (i.e., the unique ids) were selected by checkboxes. How would I go about this?

The HTML table is on a form with a POST method. So, for example, if a user checks the checkbox on John's row, how can I retrieve John's ID into a $_POST array?

None of my books go into this specifically. They only give checkbox examples such as What is your fav. ice cream? Vanilla, Chocolate, blah, blah.

Thanks!
Dave

Note: the above table is, of course, simplified. The HTML table actually contains about a dozen fields and up to a couple of hundred records resulting fromt the db query.
Dave is offline  
Reply With Quote