Thanks mike, I used your idea and it works great: 
http://www.kvic.com/messages.epl
You know, it shouldn't have to be done this way but hey, what ever works! :)

http://www.singlespeedsanonymous.com/

        "People are the worst drivers in the world" -Gavin Spomer

>
>I recently did a message board in embperl as well. Ran into the same
>problem.
>Using a mysql backend. Id open a database handle, get a statement handle
>(select where parent=0), and then do my get_children routine which would
>get all of the children.. but it seemed that embperl sub's would kill
>the 
>recursive statement handles..
>
>I did get it to work. I grabbed all of the parents, threw them into an
>array @parents.. well.. psuedo-code
>
>sub get_children {
> my $id = shift;
> @cids = ();
> select where parent=$id
> while $cid = fetchrow { 
>  push($cid,@cids);
> }
> foreach $id (@cids) {
>  push($cid,@ids);
>  get_children($cid);
> }
>}
>
>sub get_messages {
> select where parents=0
>  while $id = fetchrow {
>  push($id,@parents);
> }
>
> foreach $pid (@parents) {
>  push($pid,@ids);
>  get_children($pid);
> }
>}
>
>sub displaymsgs {
> foreach $id (@ids) {
>  select needed info
>  display...
> }
>}
>
>Works like a champ.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to