thomashw Posted January 7, 2008 Share Posted January 7, 2008 I'm going to have a menu on the left column on my website in which I want to use my database for. I'm having trouble thinking of how to set this up in my database. I want each menu item to have a url like this: index.php?category_id=... The menu is structured like this: So when menu 1 is clicked on, I'll need the submenu's to show. And when the submenu's are clicked on, I'll need the subsubmenu's to show. This structure is duplicated for menu 2, menu 3, etc. The reason I want to use the database is because I'll have so many menu's, submenu's, and subsubmenu's that it will take forever to make/edit/change them if I want to. When I say "show" I don't mean a pop-up menu. I mean it goes to the next page with the submenu links showing. I'm wondering if anyone has any ideas as to how to set up my database/a way to code this that I'm not thinking of? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/84892-solved-setting-up-a-menu/ Share on other sites More sharing options...
revraz Posted January 7, 2008 Share Posted January 7, 2008 Maybe something like submenuname | parentname Quote Link to comment https://forums.phpfreaks.com/topic/84892-solved-setting-up-a-menu/#findComment-432801 Share on other sites More sharing options...
fenway Posted January 7, 2008 Share Posted January 7, 2008 Read the sticky on normalization... there's an article in there about storing hierarchical data. Quote Link to comment https://forums.phpfreaks.com/topic/84892-solved-setting-up-a-menu/#findComment-432846 Share on other sites More sharing options...
thomashw Posted January 7, 2008 Author Share Posted January 7, 2008 Thanks for the help! That article was definitely informative. Quote Link to comment https://forums.phpfreaks.com/topic/84892-solved-setting-up-a-menu/#findComment-432872 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.