View Single Post
Old 08-24-2002, 06:55 PM   #14 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
i haven't read most of whats been said up there, but you are having trouble getting multiple hierarchies out of your object or set?

i wouldn't use a "for" loop but a while

Code:
//in java
public static void start()
{
  //get the query
  //$result=mysql_query("select cat_id,cat_name from heirarchy where cat_id=parent_id"); 

}

public static void processNewCat(String catID)
{
   cat_id = catID;
   while(cat_id != null)
   {
      processNewCat(cat_id);
    }
}
erm
anyway, that doesn't mean much up there, i can't really write it in this thing (i need textpad) but you need a function that calls itself for each node and gets nodes from that node and calls itself based on them each time until the node == null then you've reached the end of a category

e.g
People
- Men
- Boys
- Blonde haired boys

people finds men, which calls the same function again for boys etc etc etc

i hope you understand this, if not im sure sdeming or techno will explain it further.. i know what im talking about.
__________________
-- bloomberg.
abc123 is offline   Reply With Quote