in reply to Re^2: Count Number of rows retrieved from SELECT
in thread Count Number of rows retrieved from SELECT

Can you include a counter (this is how I've done it in the past..)?
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.

Replies are listed 'Best First'.
Re^4: Count Number of rows retrieved from SELECT
by dtharby (Acolyte) on Jun 13, 2005 at 13:19 UTC
    thanks monarch... I will use that .... should have thought of that earlier!!! thanx