I've been looking on the web and I don't see anything that looks a) reasonably simple b) will work. I was hoping one of the superheros here could help out.
What I need to do is create a nav menu using PHP/Mysql. I'm already doing a Gallery/category structure which looks like this:
I want to make it dynamic enough to allow more levels:
-- Level 2
Obviously I don't recommend that many levels...but I figure with an n-tier script the actual number wouldn't matter.
My thought process was that each category in a level would have the following attributes:
Parent_id = '1', Child_id = '1',
Parent_id = '1', Child_id = '2',
Parent_id = '2', Child_id= '1',
Parent_id = '2', Child_id='3',
Where the parent id of the next level would be the same id of the child level above it. I was thinking I could do a sort on mysql to order by parent_id, child_id. That way if I did a select on the whole table, it should be in order to just run out in the array.
Would this work? Anyone have any better ideas?
CrimsonDryad Web Design Services
Web Design, Custom Software Development