Ok il try to explain it in more detail.
I am suppose to display some icons/images whom i refer as menu here whose path i have stored in my database.
I have 3 tables in my database.
first table is the menu table. this stores my,menu_id(primary key),menu names, parent_id and the icon path.
second table is the role table which stores role_id(primary key) and the role names.
third table is menu_role_mapping table which has map_id(primary key), menu_id(foreign key) referencing the menu table and role_id( foreign key) referencing the role table.
I ask the user to enter his role_id and accordingly i have to display the icons(whichever icons/images is assigned to that particular role_id in mapping table).
also I have to take care of the child images if any.
so please help me with the logic part to succesfully display the parent and child images based on the roleid from the database.
Hope I am able to convey the problem clearly.