I have two tables with a single common field.
Here is how these two table structures are
Table 1
+--ID--+--Title----+----others---+
| 123 | Title 1 | other values|
| 124 | Title 2 | other values|
| 125 | Title 3 | other values|
| 126 | Title 4 | other values|
+------+-----------+-------------+
Table 2
+--ID--+--Tag ID--+----others---+
| 123 | 11 | other values|
| 123 | 12 | other values|
| 123 | 13 | other values|
| 123 | 14 | other values|
| 124 | 15 | other values|
| 124 | 16 | other values|
| 125 | 17 | other values|
| 126 | 18 | other values|
+------+----------+-------------+
I want to show that Article ID 123 have 4 tags i.e 11,12,13 & 14 like the table below
+--Article ID--+--Article Title--+--Tags--+--Tag IDs------+
| 123 | Title 1 | 4 | 11, 12, 13, 14|
| 124 | Title 2 | 2 | 15, 16 |
| 125 | Title 3 | 1 | 17 |
| 126 | Title 4 | 1 | 18 |
+--------------+-----------------+--------+---------------+
I’m very new to PHP and MySQL and trying to learn it.
Someone please help me to know how I can get the desired result.
Hope this works!