Yes, a database is the best way to store this type of hierarchical data. In fact, you can store an infinite amoutn of levels using just a single table.
You simply have the MenuItem table reference itself.
MenuItem
-----------------
id int
itemName varchar
parent int
That parent column can be null (top-level category) or it can be a number referencing another item in the table, which would make it a sub-category of that item. If it doesn't have any children, it is expected to be a leaf or end-node instead of a branch.
And as @BrandonGalderisi stated, SQL Server would be a good db to use.
Main Topics
Browse All Topics





by: BrandonGalderisiPosted on 2009-01-16 at 13:33:54ID: 23397647
Store them in SQL server. If you post a sample of your XML, I can show you how the table should be structured.