Re: Checkbox/mySQL issues
| From: | lallous | Date: | Fri, 16 Aug 2002 10:00:33 +0000 |
| Subject: | Re: Checkbox/mySQL issues | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21177@lists.php.net to get a copy of this message | ||
Oh well....
it depends on how you name your checkboxes controls,
for example:
<input type="checkbox" name="answers[]" value=1>
<input type="checkbox" name="answers[]" value=331>
<input type="checkbox" name="answers[]" value=21>
<input type="checkbox" name="answers[]" value=41>
when the user selected any of the checkboxes you will have a array called
$answers which holds each of the IDs of the answers.
same for displaying the results, you can have it get selected by default as:
<input type="checkbox" name="answers[]" value=<?=$row['id']?>
<?=$condition
? ' checked': ''?>>
Elias
"Stephanie" <spiet@optimetrics.org> wrote in message
news:20020815191809.16003.qmail@pb1.pair.com...
> Here's my problem: I have a form in which there is a question and 5
> checkboxes to select from (ex: you can select more than one checkbox)
>
> I need to get each checkbox that is selected to show up when it is inputed
> into the mySQL DB.
>
> I can get the first selected checkbox in, but nothing I've done seems to
> work.
>
> Any help would be much appreciated :-)
>
> Stephanie
>
>