I need to display all the answer choices per question to the user so that he can select his answer.
Display/Markup
<?php
$i=1;
$surveyQ="SELECT * FROM ve_survey_answers a
JOIN ve_survey_questions q
ON a.QuestionId=q.id";
$surveyResult=mysqli_query($db, $surveyQ);
while($survey=mysqli_fetch_array($surveyResult)){$i++;?>
<div class="div">
<input type="radio" name="useranswer" id="radio<?=$i;?>" class="radio" value='<?=$survey['AnswerId'];?>'/>
<label class="surveylabel" for="radio<?=$i;?>"><?=$survey['Answer'];?></label>
</div>
<?php } ;?>
The query above works but it shows like this:
What kind of pet do you prefer?
Cat
What kind of pet do you prefer?
Dog
What kind of pet do you prefer?
Bird
What kind of pet do you prefer?
Reptile
How can I make it display like this?
What kind of pet do you prefer?
Cat
Dog
Bird
Reptile