I am trying to create a survey. But I just don't know how to submit my responses.
I have these tables:
surveyanswers
SurveyAnswerKey
Answer
surveycategory
SurveyCategoryKey
SurveyCategory
surveyquestions
SurveyQuestionKey
SurveyQuestion
SurveyCategoryKey
I am trying to send results to this table
survey
UserKey
AnswerKey
SurveyQuestionKey
I am using this code for the questions and answers.
<?php while ($row_rsQuestion = mysql_fetch_assoc($rsQuestion)) { ?>
<tr>
<td><?php echo $row_rsQuestion['SurveyQuestion']; ?>
</td>
<td><table width="14%" border="0">
<tr>
<?php for ($i=1; $i<=5; $i++) { ?>
<td><?php echo $i; ?></td>
<td><input name="<?php echo $row_rsQuestion['SurveyQuestionKey']; ?>" type="radio" value="<?php echo $i;?>
<?php if ($row_rsAnswer['Answer']==$i) echo "CHECKED";?>">
</td>
<?php }//end of for ?>
It looks like this
(the 0's are radio buttons)
question1: 0 1 0 2 0 3 0 4 0 5
question2: 0 1 0 2 0 3 0 4 0 5
How can I submit the surveryquestionkey and the surveyanswerkey to the survey table?