![]() ![]() Because I use that language myself, and many other people use or know that language too, I chose to write the examples in PHP. This article contains a number of code examples that show how to save and retrieve data. This food store organizes its food by category, by colour and by type. I’ll use the tree from a fictional online food store as an example. In this article, we’ll explore these two methods of saving hierarchical data. There are two major approaches: the adjacency list model, and the modified preorder tree traversal algorithm. Storing trees is a common problem, with multiple solutions. You’ll have to find a way to translate the hierarchy in a flat file. ![]() And, unless you’re using a XML-like database, tables aren’t hierarchical they’re just a flat list. Whether you want to build your own forum, publish the messages from a mailing list on your Website, or write your own cms: there will be a moment that you’ll want to store hierarchical data in a database. This is an archived copy of an article I wrote for, a web development site, in April 2003. Storing Hierarchical Data in a Database | Gijs van Tulder Gijs van Tulder ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |