in reply to Re: Re: Re: If no results come back ...
in thread If no results come back ...

further
  • Comment on Re: Re: Re: Re: If no results come back ...

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: If no results come back ...
by rdfield (Priest) on Jul 21, 2002 at 09:52 UTC
    Something like:
    my @results; while (my @row = $sth->fetchrow_array) { push @results,\@row; } if (@results) { ...we got something... } else { ...we got nothing... }
    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 = 0; while (my @row = $sth->fetchrow_array) { $results++; ...do some stuff } if ($results) { ...we got something... } else { ...we got nothing... }

    rdfield