A strange request...
I have a table with the following:
id
name
parent
It's used to store a menu. Anything with parent = 0 is top-level, and the others, the parent is the id of it's parent (get it?).
However, it's kinda unlimited levels deep, and currently I loop around it 5 times (so only 5 levels deep show up), but I'm sure there's gotta be a way do do the whole thing, so it takes a parent, all it's children, then their children etc...
Any offers?
Thanks,
Danny
I have a table with the following:
id
name
parent
It's used to store a menu. Anything with parent = 0 is top-level, and the others, the parent is the id of it's parent (get it?).
However, it's kinda unlimited levels deep, and currently I loop around it 5 times (so only 5 levels deep show up), but I'm sure there's gotta be a way do do the whole thing, so it takes a parent, all it's children, then their children etc...
Any offers?
Thanks,
Danny