这是我的桌子
注意 此表仅作为示例
帖子
++++++++++++++++++++++++++++++++++++++++
+ id |title | desc | uid |status |
++++++++++++++++++++++++++++++++++++++++
+ 1 | a | aaaa | 1 | 1 |
++++++++++++++++++++++++++++++++++++++++
+ 2 | b | bbbb | 1 | 1 |
++++++++++++++++++++++++++++++++++++++++
+ 3 | c | cccc | 2 | 1 |
++++++++++++++++++++++++++++++++++++++++
猫
+++++++++++++++++++++++++++++++++
+ id | name |parent | status |
+++++++++++++++++++++++++++++++++
+ 1 | cat1 | 0 | 1 |
+++++++++++++++++++++++++++++++++
+ 2 | cat2 | 0 | 1 |
+++++++++++++++++++++++++++++++++
标签
+++++++++++++++++++++++++
+ id | name | title |
+++++++++++++++++++++++++
+ 1 | tag1 |ttitle |
+++++++++++++++++++++++++
+ 2 | tag2 |title2 |
+++++++++++++++++++++++++
链接数据
链接为一艘 2 多关系船
链接名称 postid cat_or_tag_id
+++++++++++++++++++++++++++++
+ name | r1 | r2|
+++++++++++++++++++++++++++++
+ cat | 1 | 1 |
+++++++++++++++++++++++++++++
+ cat | 1 | 2 |
+++++++++++++++++++++++++++++
+ tag | 1 | 2 |
+++++++++++++++++++++++++++++
我想获得带有猫和标签的帖子
最好的方法是什么
我现在知道的唯一方法 是获取帖子,然后 foreach 帖子获取它的猫和标签