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_childre n($parent, $level) {
// retrieve all children of $parent
$result = mysql_query('SE LECT titolobreve,id FROM categorie '.
'WHERE parent="'.$pare nt.'";');
// display each child
while ($row = mysql_fetch_arr ay($result)) {
// indent and display the title of this child
echo str_repeat('- ',$level).$row['titolobreve']."\n<br>";
display_childre n($row[id], $level+1);
}
}
thanks!!!
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_childre n($parent, $level) {
// retrieve all children of $parent
$result = mysql_query('SE LECT titolobreve,id FROM categorie '.
'WHERE parent="'.$pare nt.'";');
// display each child
while ($row = mysql_fetch_arr ay($result)) {
// indent and display the title of this child
echo str_repeat('- ',$level).$row['titolobreve']."\n<br>";
display_childre n($row[id], $level+1);
}
}
thanks!!!