Trying to display a message if no results found in the search query.
Here is a brief example of my code.
$sql = "SELECT * FROM details WHERE ID =1"
$res =& $db->query($sql);
if (PEAR::isError($res)) {
die($res->getMessage());
}
while($row = $res->fetchRow())
{
echo 'results'
{
Any help would be greatly appreciated! Thanks
DB_resulthas a method callednumRows(), so you could checkif($res->numRows() == 0)http://pear.php.net/package/DB/docs/latest/DB/DB_result.html#methodnumRows
And you don’t need to worry about
DB_Errorsince it was already checked atPEAR::isError($res)