I am struggling to echo an error message stating 'No results' when my mysql query returns nothing. I am using PEAR. Here is what I have at the moment.
while($rows =& $output->fetchRow()) {
if (numRows($query)== 0){
echo 'No results';
}
else {
echo 'data found';
}
}
Any help will be greatly appreciated, thanks for checking out my question.