Re: nested sets?
| From: | Manuel Lemos | Date: | Fri, 21 Nov 2003 19:33:07 +0000 |
| Subject: | Re: nested sets? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-31693@lists.php.net to get a copy of this message | ||
Hello,
On 11/20/2003 12:28 PM, Ma wrote:
i try to make a clickable menu. it should be outputed as XML. i found a solution to make it possible to decend only the selected menues. but is there a easier solution? my goal is to first show only the first (level=0) level. if the user clicks on the menu it should select the second (level=1) level, but only from the menu he clicked. (so HAVING level<=1 doesn't help :( ) does anybody know a solution or a good reference for nested sets?You may want to try the famous Joe Celko's approach that he described in this book: Book review: SQL for Smarties http://www.phpclasses.org/products.html/id/1558605762.html If you do not want to reinvent the wheel, you may want to try this implementation: Class: Joe Celko Nested Sets http://www.phpclasses.org/celkonestedset -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/