Listing mysql row entries from tags into one single row
- by Derrick
Hi guys, Ive got two tables, one a listings and another representing a list of tags for the listing table.
In the listings table the tag ids are stored in a field called tags as 1-2-3- this has worked out very well for me regular expressions and joins to seperate and display the data, BUT... I now need to pull the titles of those tags into a single row. See below.
listings table
id tags
1 1-2-3-
2 4-5-6-
tags table
id title
1 pig
2 dog
3 cat
4 mouse
5 elephant
6 duck
And what I need to produce out of the listings table is:
id tags
2 mouse, elephant, duck
any suggestions?