Jump to content


This topic is now archived and is closed to further replies.


Hierarchal DB Structure

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?

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites


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.