I have two tables,
question question choices
id question id question_id choice
1 aaaa 1 1 ccc
2 bbbb 2 1 ddd
3 1 eee
I get the data using left join query using php, when I print the data it looks like this,
Array
(
[id] => 1
[question] => aaa
[question_id] => 1
[choice] => ccc
)
Array
(
[id] => 1
[question] => aaa
[question_id] => 1
[choice] => ddd
)
Array
(
[id] => 1
[question] => aaa
[question_id] => 1
[choice] => eee
)
But i want to display something like,
Array
(
[id] => 1
[question] => aaa,
array
(
[question_id] => 1
[choice] => ccc
)
array
(
[question_id] => 1
[choice] => ddd
)
)
I want to display the child table datas inside the parent so that i can prevent the question from repeating.
How can i make it using core php?