NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

Replies are listed 'Best First'.
Re: MySQL looping
by gryphon (Abbot) on Jul 19, 2002 at 23:04 UTC

    Greetings andrew,

    Please read my post about this very issue I sent to you earlier today. The answer you seek is in the code toward the lower-half of the post. Now granted, it's not the best code or example around, but it'll do what you need.

    -gryphon
    code('Perl') || die;

Re: MySQL looping
by andrew (Acolyte) on Jul 19, 2002 at 23:00 UTC
    If your still confused , im tring to find each category that makes up the category ff. "ff" has a parent number of 10, thats xx's id, and xx has a parent of 9 which is aa's and so on.
      while($id) { $sthm = $dbh->prepare("SELECT name,parent FROM category WHERE id ='$i +d'"); $sthm->execute or die $dbh->errstr; ($name,$id) = $sthm->fetchrow_array; $title = "$title >> " . $title; }
        that didnt do anything