I have a table in a database which stores categories and their description. categories can be under each other to form subcategories. So, the table has 3 fields Catname, catDesc and Cat_ID. If Cat_ID is 0, then it is a root category. Now i need my users to be able to search for text in the descipeiotns. If a suer searchs for 'hotel', it shuold be searched in say, cat1...and ALL categories udner it. Hwo do I form the query?
table e.g.
ID, Catname, catDesc, Cat_ID
1, outdoor, outdoor games, 0
2, indoor, indoor games, 0
3, cricket, cricket, 1
4, chess, chess, 2
5, batsmen, batsmen, 3
Thank you.