Array output from function into a new query
- From: Marc <spam@xxxxxxx>
- Date: Mon, 27 Mar 2006 17:30:10 +0200
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);
}
}
.
- Follow-Ups:
- Re: Array output from function into a new query
- From: Stefan Rybacki
- Re: Array output from function into a new query
- Prev by Date: Re: beginning PHP problem
- Next by Date: Re: PHP formmail getting spammed by bots
- Previous by thread: Invitation to join www.phptub.com
- Next by thread: Re: Array output from function into a new query
- Index(es):
Relevant Pages
|