I have a menu which is parent of multiple menu items and each child menu has their own child menus. This pattern is continued till 5-6 vertical hierarchy level. I don't want to write a query which contains nth level subquery as below:
select id from jos_menu where parent in(select id from jos_menu where parent in(select id from jos_menu where parent=385 and published=1))
Also, I don't want to write a script for this. There should be something in MySQL to fetch such result.
Can someone guide me about how can I achieve my result in the best way?