I have a column in mysql table named category.
Clothese category is 1
Mens clothes is 1-1
Ladies clothes is 1-2
Kids clothes is 1-3
The goal for above structure is to easily load all clothes in one page with below query.
$cat=mysql_real_escape_string($_GET[cat]);
$query="select * from campaigns WHERE category LIKE '$cat%' ";
Till here it works fine but the problem is I have another category with ID 10 for perfumes, When I want to load category 1 (including 1 itself and it's sub-categories like 1-1 ) it's loading category 10 as well.
Please let me know what is the proper solution