SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old October 3rd, 2002, 07:34 AM
luurich luurich is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Country: Estonia Town: Haapsalu
Posts: 4 luurich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to luurich
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?

Reply With Quote
  #2  
Old October 3rd, 2002, 09:44 PM
ZaireWeb ZaireWeb is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Hamburg, NY
Posts: 37 ZaireWeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to ZaireWeb Send a message via AIM to ZaireWeb
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!

Reply With Quote
  #3  
Old October 4th, 2002, 06:45 AM
luurich luurich is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Country: Estonia Town: Haapsalu
Posts: 4 luurich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to luurich
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

Reply With Quote
  #4  
Old October 4th, 2002, 07:33 AM
ZaireWeb ZaireWeb is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Hamburg, NY
Posts: 37 ZaireWeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to ZaireWeb Send a message via AIM to ZaireWeb
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:
 SELECT m.*, s.* FROM menu_cats AS mmenu_sub_cats AS s WHERE m.catID s.catID ORDER BY catOrder 


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.

Reply With Quote
  #5  
Old October 4th, 2002, 09:05 AM
luurich luurich is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Country: Estonia Town: Haapsalu
Posts: 4 luurich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to luurich
yes it's nice but what if the submenu has got a subsubmenu allso..

does it work then??

Reply With Quote
  #6  
Old October 4th, 2002, 08:36 PM
ZaireWeb ZaireWeb is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Hamburg, NY
Posts: 37 ZaireWeb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to ZaireWeb Send a message via AIM to ZaireWeb
Hrm..

I never had to worry about that... Good Point!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > about submenus and cycles


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway