I am looking for designing a database structure for a treeview plugin.
The nodes should be populated from the database. The root node can have unlimited level of child nodes and each child node can further have unlimited level of sub-child nodes.
Can someone please suggest me the database structure and possibly the query to fetch each nodes/child nodes.
This is a structure I have thought of so far but I am not sure if this is the proper way i should be desining the table.
the adjacency model is the easiest to understand and manipulate, but to retrieve unlimited sublevels with a single query is impossible without recursion (note: see http://sqllessons.com/categories.html if your interface will be showing only a limited number of sublevels in a single display)
you’re probably going to want to use the nested set model