Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is suppost to be printing 25 not 124$a = find_items("26"); print "$a"; sub find_items { $idd = shift; $sth3 = $dbh->prepare("SELECT category FROM items WHERE category = '$ +idd'"); $sth3->execute or die $dbh->errstr; $rvf = $sth3->rows; $a += $rvf; $sth23 = $dbh->prepare("SELECT id FROM category WHERE parent = '$idd' +"); $sth23->execute or die $dbh->errstr; while ($idg = $sth23->fetchrow_array) { $item = find_items($idg); $a += $item; } return($a); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing wrong results
by cfreak (Chaplain) on Jul 26, 2002 at 19:35 UTC | |
|
Re: Printing wrong results
by Anonymous Monk on Jul 26, 2002 at 19:23 UTC | |
by Anonymous Monk on Jul 26, 2002 at 19:27 UTC |