分開後,我有這樣的如何從逗號笨
tbl_post
+-----------+--------------+
| post_id | post_content |
+-----------+--------------+
| 1 | contentone |
+-----------+--------------+
tbl_category
+-------------+---------------+
| category_id | category_name |
+-------------+---------------+
| 1 | Politic |
| 2 | Social |
| 3 | Economy |
+-------------+---------------+
tbl_category_post
+------------------+-------------+---------+
| category_post_id | category_id | post_id |
+------------------+-------------+---------+
| 1 | 1 | 1 |
| 2 | 2 | 1 |
| 3 | 3 | 1 |
+------------------+-------------+---------+
表每個ID選擇從其他表中的多個數據
然後,我想這樣的
+--------------+--------------------------+
| post_content | category |
+--------------+--------------------------+
| 1 | Politic, Social, Economy |
+--------------+--------------------------+
,然後輸出如何顯示這樣使用笨的數據,我真的很困惑可言,誰能請幫幫我!
使用數據庫 「內連接」 的聲明。 http://stackoverflow.com/questions/16013364/inner-join-with-3-tables-in-mysql – Xorifelse