I am trying to bhuild a drill down menu for my website, where user will click on a category and it will show the subcategories of that clicked category, there could be n-levels. 
I am able to write sql query which returns the output exactaly as I want, but the problem is...I dont want to show the whole menu to end user, I would like to open/expand only clicked category.
    my Query output is:
1 IPTV
2      Jadoo Tv
3      Shava Tv
4      Jalva Tv
5 Programming
6      Microsoft
7           Asp.Net
8      PHP
so by default IPTV & Programming Should be displayed, since they are parent, and when I click on IPTV it should open the children of IPTV, like I said there could be n-levels. 
I was thinking, I can load the output of query to webpage and then control the menu navigation with css/javascript. 
do you guys have any ideas?