Jump to content


Photo

Hierarchal DB Structure


  • Please log in to reply
2 replies to this topic

#1 Eric_Ryk

Eric_Ryk
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts

Posted 10 December 2005 - 11:15 PM

I'm building a cookie crumb trail and I have categories, but they have no limit as to how far the depth can be (will probably only be 4 at max though). What I am trying to do is find a way to select the parent of a given parent, and its parent, and its parent, etc. until there isn't a parent. I'd prefer to do this all in one query. Right now I'm just making up terms, but I think it would be referred to as a recursive query. How can I do this in MySQL?

#2 Arenium

Arenium
  • Staff Alumni
  • Advanced Member
  • 111 posts
  • LocationMassachusetts

Posted 11 December 2005 - 02:44 AM

You've opened a can of worms. It's official! Enjoy the following thread and all the links within it.

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=63832\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=63832[/a]


#3 Eric_Ryk

Eric_Ryk
  • Members
  • PipPipPip
  • Advanced Member
  • 104 posts

Posted 11 December 2005 - 03:17 AM

[!--quoteo(post=326288:date=Dec 10 2005, 09:44 PM:name=Arenium)--][div class=\'quotetop\']QUOTE(Arenium @ Dec 10 2005, 09:44 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
You've opened a can of worms. It's official! Enjoy the following thread and all the links within it.

[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=63832\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?showtopic=63832[/a]
[/quote]
Yay! Now I get to practice using the nested set .

Thanks for the help.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users