Hi,
I want to make a recursive function generating a hierarchy using a class.
The following code works fine when I don't wrap the function around it,
but when I do it fails. I can't figure out why...
I'm thinking I may need to make some vars global, or maybe you can't use
objects inside functions? (No, couldn't be)
Here's the code:
.........
$root = $tree->open_tree ($title, "");
function generate_nodes($id) {
$sql = "select * from hierarchy where parent = $id";
$res = mysql_debug_query($sql);
while ($row = mysql_fetch_array($res)) {
$node = "node" . $count;
$$node = $tree->add_folder ($root, $row["name"] . " <font
size=1>" . $row["id"] . "</font>", "");
$count++;
}
}
generate_nodes($id);
........
Thanks for any hints...
Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://liga1.com: building multiple language/culture websites
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]