multiple entries for questionaire
| From: | Rodney Davis | Date: | Wed, 27 Sep 2000 06:58:23 +0000 |
| Subject: | multiple entries for questionaire | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17682@lists.php.net to get a copy of this message | ||
I am trying to build an online questionaire in php. For the most
part everything is straight forward but I have a questions that
will have multiple answers and I don't know how to gather that
and stick it into MySql.
Problem Background:
questionaire question:
3. Please indicate which places you have been to in the last 5 years:
'96 '97 '98 '99 '00
Hawaii _1_ _2_ _3_ _4_ _5_
Guam _6_ _7_ _8_ _9_ _10_
Korea _11_ _12_ _13_ _14_ _15_
etc.
The end users would be able to mark as many as are appropriate.
I need to gather this data and put into a MySql database as follows:
answer_id|Q_id |user_id |answer |
1 3 55 1
2 3 55 15
3 3 55 12
4 3 55 5
This way, I can track that the same user answered
question 3 with four different answers (Hawaii'96,
Korea'00, Korea'97, Hawaii'00).
I am planning on using checkboxes on a web page for
gathering the info.
The Question:
I need some kind of looping statement to gather this from the browser form
and insert it into MySql. Can anyone point me to an example that I can
get some ideas for doing this. Or, can someone lead me to the right PHP
function to get started? Or is this just a stupid solution for this
problem?
Thank you in advance.
rodney