Quote:
Originally Posted by vdbucks
Not really sure what you're trying to accomplish as it doesn't appear as though your example matches your explanation.
Are you trying to do something like:
Code:
idParent* = 1
|
---> idChild => 2,3,4,5,6 #so on and so forth
From the sounds of your description, this is what you mean.. but from your example it's not. But then, the example you gave doesn't show how the idChild 6 has the root idParent of 1 to begin with... Unless of course I'm missing something.
All in all, more information is needed.
*I'm not including additional idParent values as of now in order to get an exact idea of what you're trying to accomplish.
|
I "think" what he's looking for is to keep checking for a parent until there are none... So if he starts with idChild = 6, it's parent is 4.. Then he checks child 4 exists and finds it has a parent of 2.. Then he checks child 2 and finds it exists with a parent of 1.. Then he checks child 1 and find there is no child so the root parent is 1.