After some hours of hard research I can't find an answer that works for me, would appreciate help.
Case:
Table1 contains column "category", a post can be assigned 3 categories and will be stored in Table1 > category column as 0|1|6|23|0 (3 categorie ids being 1,6 and 23)
Table2 contains category names, category ids.
I want to show in what categories a poster is most active in, limit to 5, AND i want to eliminate duplicates, e.g. post 1 has category 1,2,3 and post 2 has category 2,3,4
result should gove 1,2,3,4 (eliminating the double 2 and 3)
as per post, the category column is an array, i cannot seem to get the right MySql query setup
I got something like this which does not work correctly:
$sql="SELECT DISTINCT * FROM TABLE2 as a, category FROM TABLE1 as b WHERE a.CID=b.category LIMIT 5";
as the category in TABLE1 is stored like 0|1|6|23|0 i cannot proceed