Hey again,
Here is my code and I am having search issues... if they put in a search for a latname, firstname, and district it will give back everyone in that district or with any part of those names... how can i do it so that it will narrow the search parameters and just give back relevant data that matches either a firsname and a district , or a last name and a firstname, or a district and a lastname and so on...
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h4><strong><font face="Arial, Helvetica, sans-serif">OATA Search Results:</font></strong></h4>
<p><font size="2" face="Arial, Helvetica, sans-serif"><a href="findmem.html">Back>Search Again</a></font></p>
<p>
<? mysql_connect(localhost,oataorg_ohioata,atmedical);
@mysql_select_db(oataorg_memdb) or die( "Unable to select database");
if(mysql_error())
echo mysql_error();
$lastname = $POST['lastname'];
$firstname = $POST['firstname'];
$district = $_POST['district'];
$query="SELECT * FROM membinfo WHERE lastname = '$lastname' or firstname = '$firstname' or district = '$district'";
$result=mysql_query($query) or die (mysql_error());
$num=mysql_numrows($result);
?>
<table>
<?
while ($row = mysql_fetch_array($result)) // this will grab the results from query
{
?>
</p>
<table>
<tr>
<td>
<? echo $row['Id']; ?>
</td>
<td>
<font color="#0000FF" size="3" face="Arial, Helvetica, sans-serif"><strong><? echo $row['lastname']; ?>, <? echo $row['firstname']; ?></strong></font><br>
<strong><font size="3" face="Arial, Helvetica, sans-serif">District:</font></strong> <? echo $row['district']; ?><br>
<strong><font size="3" face="Arial, Helvetica, sans-serif">Work Phone:</font></strong> <? echo $row['work']; ?><br>
<strong><font size="3" face="Arial, Helvetica, sans-serif">Email Address: </font></strong> <a href="mailto: <? echo $row['email']; ?>"> <? echo $row['email']; ?> </a><br>
<hr width=75%></td>
</tr>
<?
}
?>
</table>
</body>
</html>
any suggestions on making it a better more defined search that won't give me SOOO many results? I assume it has somehting to do with the AND, OR, = parameters and so on... do i need to split it up?
Jon