I have feed with entries where each entry (row) has 7 different categories. I need to list all these categories, these are repeating often so I need list only of unique categories. Categories are category1....category7 and there is at least 1 value for each row. I found only this function http://cz.php.net/manual/en/function.array-unique.php and also GROUP BY but I am not sure how to combine it to get simple output of all categories in DB.
SELECT DISTINCT category_name from table_name WHERE .... DISTINCT will fetch values which are unique...
But I would have to use something like: SELECT DISTINCT category1,category2,...,category7 from table_name I need to get all entries from categoryX and than select those uniques.
OK, could not wait and I spent whole day playing around and here is what I needed. I hope it will be helpful to someone since I found few similar questions like this.