php - Returning results from MySQL as a multidimensional array -
i have store tree data structure in mysql table. node can have number of children , depth of tree not fixed. have created table column of parent node can traverse tree.
i need fetch whole tree rooted @ given node table , render in php page. can make procedure return children of given parent , render it. have fire query recursively each node.
want return whole tree structure rooted @ given node in single query. there way ?
what looking 'ways of storing hierarchical data' in relational databases.
if want avoid recursion have duplicate bit of data in form of column or table holding ancestor/descendant information.
have @ following url describing few ways of doing this: http://www.sitepoint.com/hierarchical-data-database/
Comments
Post a Comment