I got a product table like this
id | name | category
1 | name1 | 2,1,5,8,9
2 | name2 | 2,1
3 | name3 | 5,8
And I got a category table like this
id | catname
1 | cat_name1
2 | cat_name2
5 | cat_name3
8 | cat_name3
9 | cat_name3
Each product can have multiple categories. Categories associated with that product are saved in a row named "category" in product table as "1,5,8,7", Where each represent category table's id.
Now I want to display all the products came under a specific category.
I am little bit confused with the query to handle this.
And is this the correct format for saving such type of data ? Please advice