Originally Posted by Old Pedant
Okay. This table design is less than ideal. Obviously created by an amateur in the world of multi-level categories.
If it were mine, I would throw it away and create my own, but I'm sure you don't have that luxury.
Under the circumstances, you really do not have any choice but to create what I call "dependent selects" or "dependent drop-downs".
That is, first you will show all the top-level categories in one <select>.
Then, *AFTER* the user chooses a top-level category, you show all the first level subcategories.
Then, *AFTER* the user chooses a first level subcategory, you show all the second level subcategories.
And so on, for as many levels as you choose.
I have to say, this is some really really bad data.
Just to pick a couple of examples from *ONLY* the records you showed me, we have these "chains":
TV-Shows ==> Buffy the Vampire Slayer ==> Characters ==> Angel
TV-Shows ==> Angel
(Is there really a TV show named "Angel"??)
Ugh. I really really hate this.
Well, anyway, you have three choices on how to do this:
(2) Use ONLY PHP. So that each time the user makes another selection in a <select> list, you send all the data back to your PHP page which rebuilds the page with the new subcategory, etc.
What do you think?