Hello iceman2g,
you haven't posted the whole code but I assume the checkboxes are within a form.
I also assume you just have more than one checkbox on that page,
I also assume you have something like a submit-button to trigger the database query.
Well, as far as I remember, (correct me if I'm wrong) checkbox values are passed as $POST and not as $GET which would mean you would have to chage your form method to post first.
Then, if you have more than one checkbox you must define the name as array in your input definition, and the value should be a static integer, normally 1, $selection can be set behind (I assume it's just a description or title, etc),
like this:
echo"<td><input type=\"checkbox\" name=\"id[$id]\" value=\"1\">$selection</td>";
instead of
echo"<td><input type=\"checkbox\" name=\"id\" value=\"$selection\"></td>";
On the resulting page with the query and output you should put this code on top of the php-block to have direct access to your variables passed to it:
if(!empty($_POST)
extract($_POST);
This way you can loop through thi id-array as it was a local variable.
Then you would have to create a loop to construct the "WHERE"-clause,
eg like this:
$where = "";
foreach($id as $k => $v){
if($v == 1){
if(empty($where))
$where .= "WHERE answer ='".$k."'";
else
$where .= " OR answer='".$k."'";
}
}
The last thing you have to do is to query the database and display the results.
Hope this helps
best regards
gaucho