php / Mysql best tree structure
I have to build a tree that will contain about 300 nodes inside it. The tree has no depth limitations. So it can have 3 or 15 levels. Each node can have an unlimited number of children. The priority is to get a complete tree / subtree the faster as possible, but I also need to add nodes or move nodes sometimes but not that often. I want to know the best way to store the tree in the database and the best way to retrieve the data, if possible, in php. You can use a Nested Set Model as it yields very efficient queries. Check out Managing Hierarchical Data in MySQL and read the section called