this database query seems to be working, but perhaps there is an easier or more logical way of doing it.
the script is supposed to pull APN, LASTNAME, STREETNUM, and STREET from the PROPERTY table if the variables match the form entries, AND if property0202.apn = exclude2002.apn
does this seem right to you?
also, how can i make it display some message if nothing is found? right now it just show the blank html page.
<?php
mysql_connect (localhost, remeed, typethis);
mysql_select_db (remediation);
$query = "SELECT property0202.apn, property0202.lastname,
property0202.streetnum, property0202.street
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 ("Query Failed");
while ($row = mysql_fetch_array ($result))
{
printf (
"<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]);
}
?>