RE: Search results
| From: | Andrew Chase | Date: | Wed, 06 Feb 2002 20:43:04 +0000 |
| Subject: | RE: Search results | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16580@lists.php.net to get a copy of this message | ||
You can use mysql_result_rows() to check whether any rows were returned;
something like:
<?
if(mysql_result_rows($result) > 0){
while ($row = mysql_fetch_array($result)) {
//Do stuff with result rows here
}
}else{
echo "Sorry your search returned Zero Rows";
}
?>
HTH,
-Andy
> -----Original Message-----
> From: Todd Williamsen [mailto:todd@williamsen.net]
> Sent: Wednesday, February 06, 2002 10:17 AM
> To: php-db@lists.php.net
> Subject: Search results
>
>
> I have done a search page based on a specific column name, but in some
> columns there is no results to be returned..
>
> What I would like to do is display an error message stating that
> there is no
> results .. something like "Sorry your search returned Zero Rows"
>