| Database Menu into array
|
Marked

msg:4084119 | 1:51 am on Feb 21, 2010 (gmt 0) | Hi all, I am currently trying to further my website-forum integration by recreating the menu(generated from the database) in my forums. To do this, I am trying to put all the menus and submenus into an array. The tricky part is getting the submenus into the array, which I am lost with. To make things clearer, here is an image with some of the rows: <snip> So I need to get the menus into an array(using a query similar to the one in the image), with similar levels. The parent field determines their levels. However, I also need to store the ID for each menu. I'd like the array to display something like this: Level1 --Level2 --Level2 --Level2 Level1 --Level2 --Level2 --Level2 -----level3 -----level3 -----level3 Sorry if this post is confusing, Thanks in advance, Mark. [edited by: eelixduppy at 1:56 am (utc) on Feb 21, 2010] [edit reason] removed url [/edit]
|
Marked

msg:4084152 | 3:04 am on Feb 21, 2010 (gmt 0) | Sorry for the double post, the edit is not working. It seems a mod removed my image. The table structure is as follows id| name| parent| ----------------------- 1 Menu 1 0 2 Menu 2 0 3 Menu 3 0 4 Menu 4 1 5 Menu 5 1 6 Menu 6 4 7 Menu 7 4 <-notice this is a sub menu of a submenu
|
|
|