Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: If no results come back ...

by andrew (Acolyte)
on Jul 21, 2002 at 03:31 UTC ( [id://183744]=note: print w/replies, xml ) Need Help??


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

It has to be in a while or for statement cause it gets more than 1 row

Replies are listed 'Best First'.
Re: Re: Re: If no results come back ...
by Anonymous Monk on Jul 21, 2002 at 03:52 UTC
    so what is the problem? ( why don't you just put it in a while or for loop or do you need further instruction?)
      further
        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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://183744]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-23 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found