[HELP] retrieve TREE structure from mysql db

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

as subiect says, i already know how to print a tree structure using a
recursive function but what i want is to save the results in a
multidimensiona array so i will be able to format them in a table with
graphic etc

the funciont that i am using to simple print the structure is:

function display_children($parent, $level) {
   // retrieve all children of $parent

   $result = mysql_query('SELECT titolobreve,id FROM categorie '.
                          'WHERE parent="'.$parent.'";');

   // display each child
   while ($row = mysql_fetch_array($result)) {
       // indent and display the title of this child
       echo str_repeat('- ',$level).$row['titolobreve']."\n<br>";

       display_children($row[id], $level+1);


Site Timeline