my $count = 0; while ( my $row = $sth->fetchrow_arrayref() ) { $count++; # do something with $row.. } print( "There were $count row(s)\n" );
I know what you're asking and it's a worthy question, I just haven't tried working it out for myself because I've just used either of the two techniques I've mentioned instead.
In reply to Re^3: Count Number of rows retrieved from SELECT
by monarch
in thread Count Number of rows retrieved from SELECT
by dtharby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |