|
Posted by Marc on 09/28/10 11:43
Hi there,
I've got this function and I want to fill a new query with the output of
this function. But I only get one value out of the array. How can I pass
the output of this function into a new query?
tnx marc
// $parent is the parent of the children we want to see
// $level is increased when we go deeper into the tree,
// used to display a nice indented tree
function display_children($parent, $level) {
// retrieve all children of $parent
$result_btnt = mysql_query('SELECT nt FROM btnt '.
'WHERE bt="'.$parent.'";');
// display each child
while ($row = mysql_fetch_array($result_btnt)) {
// indent and display the title of this child
return $row['nt'];
// call this function again to display this
// child's children
display_children($row['nt'], $level+1);
}
}
Navigation:
[Reply to this message]
|