我有一个线程表和一个评论表。当我做mysql查询时,一个线程可以有很多评论。由于许多评论,它成为重复线程。如何分组 tid?
我在php中尝试了foreach,但仍然不知道。
Array
(
[0] => Array
(
[tid] => 110
[title] => This is question
[vid] => 175
[yesno] => 1
)
[1] => Array
(
[tid] => 110
[title] => This is question
[vid] => 179
[yesno] => 0
)
)
我真的想要这个
Array
(
[0] => Array
(
[tid] => 110
[title] => This is question
[0] => Array(
[vid] => 175
[yesno] => 1
)
[1] => Array(
[vid] => 176
[yesno] => 0
)
)
)