RE: [PHP-DB] Checkbox/mySQL issues
| From: | Rob Day | Date: | Thu, 15 Aug 2002 20:17:52 +0000 |
| Subject: | RE: [PHP-DB] Checkbox/mySQL issues | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21162@lists.php.net to get a copy of this message | ||
Stephanie,
Take a look at this:
<input type="checkbox" name="option_val[]" value="1">Option 1
<input type="checkbox" name="option_val[]" value="2">Option 2
<input type="checkbox" name="option_val[]" value="3">Option 3
Look at the names of the checkboxes. If they are all the same and end with
[] as above, PHP will toss them into an array. So in the script that
processes the form you will have access to an array named $option_val. Hope
that helps.
-Rob
-----Original Message-----
From: Stephanie [mailto:spiet@optimetrics.org]
Sent: Thursday, August 15, 2002 2:18 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Checkbox/mySQL issues
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php