in reply to Nested Categories

look at normalizing results from a db query

Update: and, further below in the thread for a complete solution.