[SOLVED] help retrieve value from function
Posted: Fri Mar 09, 2007 7:46 pm
Hello, pls advice.
I have this function
i am interested retrieving the $treeId from this function and assign it's value to something else.
if I use insted of the function stops executing, but if I use the value it's displayed and i don't want that.
Any ideeas?
Thx
I have this function
Code: Select all
function children($parent) {
global $database;
$result = $db->query("SELECT * FROM tree WHERE (parentId = '".$parent."')");
while ($row = $result->fetch()) {
@extract($row);
echo $treeId;
children($treeId);
// call this function again
// child's children
}
}if I use
Code: Select all
return $treeId;Code: Select all
echo $treeId;Code: Select all
echo $treeId;Any ideeas?
Thx