in reply to Re: Re: Re: Re: If no results come back ...
in thread If no results come back ...
might help, though I woundn't use it in the case where a large result set is expected/possible. If large results sets are expected/possible then a flag might help:my @results; while (my @row = $sth->fetchrow_array) { push @results,\@row; } if (@results) { ...we got something... } else { ...we got nothing... }
my $results = 0; while (my @row = $sth->fetchrow_array) { $results++; ...do some stuff } if ($results) { ...we got something... } else { ...we got nothing... }
rdfield
|
---|