adjacency-list-model

SQL to reorder nodes in a hierarchy

I've got a 'task list' database that uses the adjacency list model (see below) so each 'task' can have unlimited sub-tasks. The table has an 'TaskOrder' column so everything renders in the correct order on a treeview. Is there an SQL statement (MS-SQL 2005) that will select all the child nodes for a specified parent and update the TaskO...

Adjacency List Model with two tables

So I think my issue boils down to two questions: How do I build a traversable tree structure in PHP when the tree is stored in MySQL (between two tables) using the Adjacency List Model approach while keeping performance in mind? What's a maintainable approach to displaying the tree in the needed formats without duplicating traversal co...

Help on displaying data in colunm PHP MySQL (Modified Preorder Tree Trasversal)

Hello I'm trying to get a multicolumn display (if it can be called so) with the code below here is the result: . Someone can see why These leaves are broken? or tell me please which is better: a catagory table linked to a subcatery one, or an adjacency model list. $stmt = $conn->prepare("SELECT node.idCat_ad ,node.".$cat_name.",(COUNT...