Re: Storing duplicate checkbox values
| From: | (Miles Thompson) | Date: | Thu, 17 May 2001 01:00:06 +0000 |
| Subject: | Re: Storing duplicate checkbox values | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9387@lists.php.net to get a copy of this message | ||
I'm just winging this off the top of my head.
If you are absolutely sure that the order of the checkboxes will NOT CHANGE, and that is a very risky assumption. And assuming that you have an array to hold the values for the checked box, why not just store the value of the index for each question? Or assign some other arbitrary value to each checkbox?
Alternative which does the same thing in less space. Use a drop down list ( combo box ) to display the possible answers for each question and store some key value for the question.
So much of this is governed by what you want to do with the gathered information.
Hope this has been of some help - Miles Thompson
At 06:42 PM 5/16/01 -0600, John Starkey wrote:
Ok This one has me stumped. I'm working on a survey for an author. There is already a total of 35 questions and their corresponding columns in the main table. She has three other questions that have identical checkboxes, 30 each. I want to put them in the second table and just make reference to the record_id from the main table and the question number, so that I don't end up with 90 columns in this second table. Anyone have any suggestions on a quick way to do this? Obviously the checkboxes will need to have unique names, but the columns won't. I'm pretty fried on this and ready to take the not so efficient route of having 90 columns. This is a MySQL/PHP4 job. Thanks, John -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net