|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
about submenus and cycles
the problem...
i ma making a menu... it contains main menu and submenus main menu sub menu sub menu sub menu How can i get all the submenus whit one or two cycles? |
|
#2
|
|||
|
|||
|
I don't understand what you mean, with 1 or 2 cycles...
Where is the data coming from?
__________________
Eric Coleman - Co-Owner ZaireWeb Solutions eric.coleman@zaireweb.com http://sitemod.net - sitemodCMS Coming Soon! |
|
#3
|
|||
|
|||
|
data is coming from database...
the question is how can i make a query that would bring out all the submenus... catch is taht there can be endles number of sumbmenus mainmenu submenu1 subsubmenu1 subsubmenu2 subsubsubmenu1 subsubsubmenu2 and so on.... subsubmenu3 submenu2 submenu3 |
|
#4
|
|||
|
|||
|
I have a table structure like this
Code:
+---------------------------------------+ | Table: menu_cats | +---------------------------------------+ | catID | catName | +---------------------------------------+ +---------------------------------------+ | Table: menu_sub_cats | +---------------------------------------+ | catID | subID | subName | catOrder | +---------------------------------------+ Here is some sample input: Code:
+---------------------------------------+ | Table: menu_cats | +---------------------------------------+ | catID | catName | +---------------------------------------+ | 1 | Main Menu | +---------------------------------------+ +---------------------------------------+ | Table: menu_sub_cats | +---------------------------------------+ | catID | subID | subName | catOrder | +---------------------------------------+ | 1 | 0 | Sub 1 | 1 | | 1 | 1 | Sub 2 | 2 | | 1 | 2 | Sub 3 | 3 | +---------------------------------------+ Then a query like so: PHP Code:
That should give you the data you need. Now, you can just use a while() loop to print them out ( or should be able to.. ) I wrote a menu system like this, that's templateable. It's at home on my laptop, and I would be willing to send it to you when im home, just send me an email @ eric.coleman@zaireweb.com Eric Last edited by ZaireWeb : October 4th, 2002 at 07:35 AM. |
|
#5
|
|||
|
|||
|
yes it's nice but what if the submenu has got a subsubmenu allso..
does it work then?? |
|
#6
|
|||
|
|||
|
Hrm..
I never had to worry about that... Good Point! |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > about submenus and cycles |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|