I created a MySQL database containing data as,
product_id with data - 1200, 1201, 1202.....
product_name with data - product1, product2, product3......
all_category_id(varchar75) with data - (3, 2), (1, 15, 2), (3, 7, 9) ....(two or more category id as varchar. since, many products have more than one category)
Every category ID has a name e.g
1 - arts
2 - entertainment
3 - Games
15 - movies
I'm trying to pull the product list category wise e.g.
select * from tablename where category=1(that is arts)
I used "regexp" but not working perfectly, e.g.
when i say,
select * from tablename where field regexp '.1.';
it returns, products from arts and also movies category as it contains "1" in its ID "15" But I want the list of only arts
So can anyone suggest me solution to get the desired result? I don't want to change the database structure
Thankx in Advance