in reply to walking a tree
If you think about how things happen sequentially, walktree only returns once $children->fetchrow fails. Then right after it returns, the first thing the caller tries to do is $children->fetchrow!
To fix this, either make new statement handles within each call to walktree, or else fetch all of the results from the $children query into an array before recursing at all.
blokhead
|
|---|