Hello,
I have a strange problem with a recursive function, that displays a tree like structure of messages.
the code is something like this:
function show_childmsgs($msg_id) {
global $tmplate;
$result = mysql_db_query($querystring);
while ( list(vars..)=mysql_fetch_row($result)) {
...
$tmplate->set_block(..);
$tmplate->pparse(..);
...
show_childmsgs($next_msg_id);
}
}
the $tmplate variable is declared in another file (it's a Template class from the PHPLib).
The problem is that the loop runs correctly only once. After show_childmsgs() calls itself the first time, any of the calls to the Template class methods produce no output.
I'm a total newbie at PHP, so i don't really understand my problem. If anyone could point me in the right direction I would be very happy!
Regards,
espen