Results 1 to 1 of 1
Feb 13, 2011, 08:55 #1
- Join Date
- Feb 2003
- 0 Post(s)
- 0 Thread(s)
Nested Set - Disabled categories flag
Hi, I am developing a navigation system using the nested set methods (in PHP / MySQL) based on the probably infamous MySql article.
I have stumbled upon a problem that I can't think round at the moment! How do I add a flag to disable a category and it's sub categories?
The select needs to only select categories where active=1 but still in the hierarchy, this is the bit I am stuck on.
The current query is:
SELECT node.name, (COUNT(parent.name) - 1) AS depth FROM nested_category AS node, nested_category AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt GROUP BY node.name ORDER BY node.lft;
Any help would be greatly appreciated, thank you.