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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -