For the longest time I've been working with a categorization system that only allows for 1 level of nesting (parent -> child_1), but now I have a requirement to add more. I can easily allow for an arbitrary number while knowing that the more levels of categories I add, the longer and more complex the SQL will be from extra joins, but I want to know if anyone has figured out a way to do infinite levels of nesting (parent -> child_1 -> child_2 [ -> child_n ]).
I can't fathom a way to do this (there are no loops or recursive functions in MySQL that I am aware of), but I thought I would ask before programming an arbitrary restriction into the system.










Bookmarks