hello-
i have the following php search a database, and everything works fine except if no records are are found i just end up with a blank page.
i want an error to be written to the page saying that no records were found or something.
$query = \\"SELECT property0202.apn, property0202.lastname,
property0202.streetnum, property0202.street,
exclude2002.apn FROM property0202, exclude2002
WHERE property0202.apn LIKE \\'$apn%\\'
AND property0202.streetnum LIKE \\'$streetnum%\\'
AND property0202.street LIKE \\'$street%\\'
AND property0202.lastname LIKE \\'$lastname%\\'
AND property0202.apn = exclude2002.apn
ORDER BY property0202.apn, property0202.lastname,
property0202.streetnum, property0202.street\\";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array ($result)) {
sprintf (
\\"<table>
<tr>
<td>APN</td>
<td>LAST NAME</td>
<td>STREET NUMBER</td>
<td>STREET NAME</td>
</tr>
<tr>
<td> %s </td>
<td> %s </td>
<td> %s </td>
<td> %s </td>
</tr></table>\\n\\",
$row[0], $row[1], $row[2], $row[3]);
}
?>