[eluser]CroNiX[/eluser]
I use nested sets a lot, but not this implementation. From what I can see from your example, nothing in tree 2 should have the same left/right ids as those in tree 1. They are different, separate trees. Trees don't share branches with other trees. Since they are in this case, it's making it a single tree in the output because the left/right IDs from tree 2 fall within those of tree 1. To build a tree, you are saying "give me everything that has a left id between the left and right id of the root node". How is it supposed to do that, and keep them separate, if the nodes left/right ids are the same for both trees?