zgkhoo Posted November 6, 2007 Share Posted November 6, 2007 how to search through a tree style of database(mysql)? binary search or? Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/ Share on other sites More sharing options...
trq Posted November 6, 2007 Share Posted November 6, 2007 Depends how exactly the tree is implimented. Nested Sets make this easy. Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385690 Share on other sites More sharing options...
fenway Posted November 6, 2007 Share Posted November 6, 2007 Depends how exactly the tree is implimented. Nested Sets make this easy. Easy? I find the method they discuss to be very difficult to maintain. Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385697 Share on other sites More sharing options...
zgkhoo Posted November 6, 2007 Author Share Posted November 6, 2007 yup...this tree searching very complex.. Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385705 Share on other sites More sharing options...
zgkhoo Posted November 6, 2007 Author Share Posted November 6, 2007 still wanna make two column for store left n right no? my DB is multiple tree ...how? ??? ??? ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385710 Share on other sites More sharing options...
fenway Posted November 6, 2007 Share Posted November 6, 2007 I usually just include a parent_uid field, have it NULL for the "parent", and then just left join in as many levels as are needed. Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385711 Share on other sites More sharing options...
zgkhoo Posted November 6, 2007 Author Share Posted November 6, 2007 I usually just include a parent_uid field, have it NULL for the "parent", and then just left join in as many levels as are needed. ya link them together i know.. but how to search and store in multiple tree DB?? ??? ??? ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385719 Share on other sites More sharing options...
fenway Posted November 6, 2007 Share Posted November 6, 2007 That's how you search and store them.... Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385725 Share on other sites More sharing options...
trq Posted November 6, 2007 Share Posted November 6, 2007 Depends how exactly the tree is implimented. Nested Sets make this easy. Easy? I find the method they discuss to be very difficult to maintain. I haven't used it in a while, but somewhere around I have an postgresql db that impliments allot of the required functionality needed for nested sets in PL/pgsql. edit: I'll see if i can find the sql when I get home. Quote Link to comment https://forums.phpfreaks.com/topic/76211-how-to-search-through-a-tree-style-of-database/#findComment-385737 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.