I am trying to build a survey for my site. All items are stored in a mysql database.
Here is my php code:
<?php do { ?>
<tr>
<td><?php echo $row_rsQuestion['SurveyQuestion']; ?></td>
<td><table width="14%" border="0">
<tr>
<td><?php echo $row_rsAnswer['SurveyAnswerKey']; ?></td>
<td><input <?php if (!(strcmp($row_rsAnswer['Answer'],"radiobutton"))) {echo "CHECKED";} ?> name="<?php echo $row_rsQuestion['SurveyQuestionKey']; ?>" type="radio" value="radiobutton">
<input name="SurveryQuestionKey" type="hidden" id="SurveryQuestionKey" value="<?php echo $row_rsQuestion['SurveyQuestionKey']; ?>"></td>
</tr>
</table>
</td>
</tr>
<?php } while ($row_rsQuestion = mysql_fetch_assoc($rsQuestion)); ?>
I can repeat the questions
I cannot repeat the Answer's
Should look like this
(the 0s are radio buttons)
Question 1 - 0 1 0 2 0 3 0 4 0 5
Question 2 - 0 1 0 2 0 3 0 4 0 5
Question 3 - 0 1 0 2 0 3 0 4 0 5
Question 4 - 0 1 0 2 0 3 0 4 0 5
Question 5 - 0 1 0 2 0 3 0 4 0 5
I am going to pass the AnswerKey and the QuestionKey to a Database table.