Eric_Ryk Posted December 10, 2005 Share Posted December 10, 2005 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? Quote Link to comment https://forums.phpfreaks.com/topic/3019-hierarchal-db-structure/ Share on other sites More sharing options...
Arenium Posted December 11, 2005 Share Posted December 11, 2005 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 Link to comment https://forums.phpfreaks.com/topic/3019-hierarchal-db-structure/#findComment-10123 Share on other sites More sharing options...
Eric_Ryk Posted December 11, 2005 Author Share Posted December 11, 2005 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/3019-hierarchal-db-structure/#findComment-10130 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.