I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2005-06-27 14:26:16-07 by alexperl
How to check if query returns no result?
Hi, if no result found in search, how can i print message saying that 'no result found' here is example:
$query = "..."; $statementHandle = $databaseHandle->prepare( $query ); $statementHandle->execute(); while ( @row = $statementHandle->fetchrow_array() ) { print "$row[0]"; }
Direct Responses: 665 | Write a response
Posted on 2005-06-28 14:38:57-07 by boyd in response to 662
Re: How to check if query returns no result?
How about this?
while ( @row = $statementHandle->fetchrow_array() ) { if($row[0]) { print "$row[0]"; } else { print "no result found\n"; } }
Boyd
Direct Responses: Write a response