Thread

Posted on Mon Jun 27 17:26:16 2005 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 Tue Jun 28 17:38:57 2005 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
Write a response