Jump to content

Hierarchal DB Structure


Eric_Ryk

Recommended Posts

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?

Link to comment
Share on other sites

[!--quoteo(post=326288:date=Dec 10 2005, 09:44 PM:name=Arenium)--][div class=\'quotetop\']QUOTE(Arenium @ Dec 10 2005, 09:44 PM) 326288[/snapback][/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]

Yay! Now I get to practice using the nested set .

 

Thanks for the help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.