Ok, so I'm a n00b, no biggie. But... It appears that these commands are functioning, now I just need to search the database for the info entered, and display it if found.
Thanks for any help!
-Illz
<?php
mysql_connect("localhost", "user", "pass")
or die("Unable to connect.");
mysql_select_db("Andrews")
or die("Unable to select database.");
/ Receive information from search.html and find the person in database Andrews, table Info /
$form_first = $HTTP_POST_VARS['first'];
$form_last = $HTTP_POST_VARS['last'];
$form_city = $HTTP_POST_VARS['city'];
$form_state = $HTTP_POST_VARS['state'];
$query = ("SELECT * FROM Info");
//assumption you require at least last name and city filled in
if (($HTTP_POST_VARS['last'])&&($HTTP_POST_VARS['city'])){
$query = $query." and last='$form_last' and city='$form_city'";
}else{
echo "Please fill in Last name and city at a minimun";
exit();
}
// if the first name has value
if ($HTTP_POST_VARS['first']){
$query = $query." and first='$form_first'";
}
//if state has a value
if ($HTTP_POST_VARS['state']){
$query = $query. " and state = '$form_state'";
}
//run the query
$result = mysql_query($query);
//rest of code to show results
?>
<table name="results" border="1" cellpadding="2">
<H1>Results</H1>
<tr>
<td><b>First</td>
<td><b>Last</td>
<td><b>Street</td>
<td><b>City</td>
<td><b>State</td>
<td><b>Zip<td>
</table>