I have stored questions and their Answer Values in mysql database table.
I want to fetch questions and their answer values as radio button.
How to achieve this ?
Current Code
id | question_field_name | question | answers
1 | gender | Gender ? | Male, Female, Transgender
2 | education | Education ? | Under Graduate, Graduate, Post Graduate
3 | like_reading | Do You Like Reading ? | Yes, No
I am using following php code to fetch questions and answers. I want to convert answers comma separated list as radio button
get_results($query);
foreach ($result as $data){
$field_name = $data['question_field_name'];
$question = $data['question'];
$answers = $data['answers'];
?>
" value="?">
### How to create here radio buttons with Answers in comma separated list stored in db in column answers
if there are three values in comma separated list, then to create three radio buttons with each values, if two then two radio buttons ...etc...