Andrew Gaffney wrote:

> Is there a way to find out how many records were returned with a DBI
> query? There's the obvious counting each record as you fetch it, but I
> need the count before I start going through them.

I'd rewrite the way you're doing it:

 my @records = @{$dbh->selectall_arrayref($query)};
 print "Your search returned $#records results.";
 for(@records) {
   ...
 }


HTH


Lee.M - JupiterHost.Net

>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to