Issues with "Message if no matching record is found"
Hello Friends,
Good day all!
Please could someone review my code and tell me where I am wrong.
Using the dreamweaver code below ( although a number of fields has been removed due to length), I want the page to echo message if no matching record is found
mysql_select_db($database_XXXXX_DB, $XXXXX_DB);
$query_rsTaxPmts = sprintf("SELECT tpmt_id, code, phone
FROM tbl_tax
GROUP BY code", GetSQLValueString($colname_rsTaxPmts, "text"),GetSQLValueString($srcphone_rsTaxPmts, "text"));
$rsTaxPmts = mysql_query($query_rsTaxPmts, $XXXXX_DB) or die(mysql_error());
$row_rsTaxPmts = mysql_fetch_assoc($rsTaxPmts);
if (($row_rsTaxPmts)== 0) {
echo "<div align='center' class='alert alert-info' style='float:none; width:auto; height:auto; background-color:#CCC;'><span style='font-size:x-large;'><i class='fa fa-info-circle' aria-hidden='true'></i> No Records found!</span><br>Do a search using Payers TIN or Phone Number</div>";
}
$totalRows_rsTaxPmts = mysql_num_rows($rsTaxPmts);
The code actually works. It show: No Records found! Do a search using Payers TIN or Phone Number as expected. But it also shows the same message once the page if loaded before I even enter my search criteria. I don't want it to show when the page is loaded. I want the message to show after I press the search button and IFF there is no matching record.
Please kindly advice me where I am wrong. I appreciate in advance.
Thank you
Mike
