Hi all, I'm really stumped here and I'm hoping some discussion will help. I need to represent our site navigation in a table in our database (I'm writing a small CMS for our site).
There will be a maximum of 5 tiers off of root but that's the only predictable thing. Each item will have an ID, name (to show in the navigation area), and URL.
I started off with these columns in addition to a parent_id column holding the ID of the item's parent in the hierarchy. That seems logical but I'm having a hard time figuring out how to work with it. Utimately I'd like to build an array or XML object with the query results in it.
Does anyone have any pointers or thoughts about this? I'm stumped. Thanks!
There will be a maximum of 5 tiers off of root but that's the only predictable thing. Each item will have an ID, name (to show in the navigation area), and URL.
I started off with these columns in addition to a parent_id column holding the ID of the item's parent in the hierarchy. That seems logical but I'm having a hard time figuring out how to work with it. Utimately I'd like to build an array or XML object with the query results in it.
Does anyone have any pointers or thoughts about this? I'm stumped. Thanks!