checkboxes names & values in mySQL (newbie)
| From: | John | Date: | Thu, 10 Oct 2002 19:40:10 +0000 |
| Subject: | checkboxes names & values in mySQL (newbie) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22323@lists.php.net to get a copy of this message | ||
I'm new at using PHP and mySQL, so please forgive my potentially naive question.
I have a series of checkboxes with different values. The user can select any number of checkboxes,
and I need to store this information in a mySQL table.
2 questions:
Should I have a unique form name for each checkbox, and store it's boolean value in the
database,
OR (is it more streamlined) ..
To create an array <input type=checkbox name=apps value =myarray[$i]> with the same name but
different value for each checkbox.
Finally, how do I construct the query to store the array of values? Do I need a separate column
(enum('n','y') for each value, or should I store all the true values as a long
text string?
If anyone has some code snippets, that would help very much.
Thanks very much!