Welcome Guest, Not a member yet? Register   Sign In
Need help: dynamic menus from database entries
#1

[eluser]parham90[/eluser]
Hello there again,

I have been thinking on this for about a month now, and I have not gotten yet a clue of how to do this. I need to put the menu structure in a database table, possibly with fields such as id, text, address, parent_id. I thought if the parent_id is 0, the item is root (I.E. one of the main menu items). If it has a parent id, it is a submenu, and the parent's id is stored in its parent_id. There is a problem here though. As this list can go on to infinity, is there a way to figure out which item is the submenu of which? Should the complete menu be constructed from top to bottom (I.E. the very first menu item, its submenus, the second and then its submenus etc), or should it be from bottom to top? And once I figure out the structure, in what way should it be stored (E.G. a two-dimensional array, or a hash table, or what)?

Thanks a lot.


Messages In This Thread
Need help: dynamic menus from database entries - by El Forum - 08-05-2010, 02:22 PM
Need help: dynamic menus from database entries - by El Forum - 08-05-2010, 03:01 PM
Need help: dynamic menus from database entries - by El Forum - 08-05-2010, 10:12 PM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 12:52 AM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 03:49 AM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 05:09 PM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 11:39 PM
Need help: dynamic menus from database entries - by El Forum - 08-07-2010, 12:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB