Associate Members Search Results

$value){
if (is_array($value)) {
$_values[$key] = join(“%,% “,$value);
$searchQuery = $_values[$key];
break;
} else $_values[$key] = $value;
$_values[$key]=stripslashes($_values[$key]);
//echo “
DBG VALUE:”. ($_values[$key]) .” “;
$searchQuery = $_values[$key];
break;
}
?>

<?PHP
function db_searchname($searchQuery) {
if($searchQuery != 'All') {
$query = "SELECT * FROM hfam_live.businesses WHERE company LIKE '".$searchQuery."%' ORDER BY company ASC";
} else {
$query = "SELECT * FROM hfam_live.businesses ORDER BY company ASC";
}
$result = mysql_query($query) or die(mysql_error());
$num= mysql_numrows($result);
if ($num == 0) {
echo "No results were found. Please go back and try again.";
} else {
while($row = mysql_fetch_array($result)) {
echo "” . $row[‘company’] . “
“;
echo “”.$row[‘address1’].”
“;
if (($row[‘address2’]) != “”) {
echo “” . $row[‘address2’].”
“;
}
echo $row[‘city’] . “, ” . $row[‘state’] . ” ” . $row[‘zip’] . “
“;
// echo “County: ” . $row[‘county’] . “
“;
echo “Phone: ” . $row[‘phone’] . “
“;
echo “Services: ” . $row[‘services’] .””;
echo “

“;
}
}
}
function db_searchservices($searchQuery) {
if($searchQuery != ‘All’) {
$query = “SELECT company, address1, address2, zip, state, city, phone, url, services FROM hfam_live.businesses WHERE services = “”.$searchQuery.”” ORDER BY company ASC”;
} else {
$query = “SELECT company, address1, address2, zip, state, city, phone, url, services FROM hfam_live.businesses ORDER BY services ASC”;
}
$result = mysql_query($query) or die(mysql_error());
$num= mysql_numrows($result);
if ($num == 0) {
echo “No results were found. Please go back and try again.”;
} else {
while($row = mysql_fetch_array($result)) {
echo “” . $row[‘company’] . “
“;
echo “”.$row[‘address1’].””;
if (($row[‘address2’]) != “”) {
echo “
” . $row[‘address2’];
}
echo “
“.$row[‘city’] . “, ” . $row[‘state’] . ” ” . $row[‘zip’] . “
“;
echo “Contact Name: “.$row[‘Name’] .”
“;
echo “Phone: “.$row[‘phone’] .”
“;
if ($row[‘fax’] != ”){
echo “Fax: “.$row[‘fax’] .”
“;
}
if ($row[‘url’] != ”){
echo “Web Site: ” . $row[‘company’] . “
“;
}
echo “Services: ” . $row[‘services’] .””;
echo “

“;
}
}
}//end of function
?>