The way you store your tree now (by storing the parent ID) means that you have to recurse to retrieve the nesting depth, and that you need to execute one sql statement per level. Other ways of storing the tree (as described in the article above) might work better, but it really depends on what you do with your data, and how often you do it.
In reply to Re: Parent/Child Association with mySQL statements
by moritz
in thread Parent/Child Association with mySQL statements
by JayBee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |