The echo of the select statement is:
SELECT `name`, `site_address`, `site_city`, `state`, `zip_code`, `telephone`, `mailing_address`, `transporter`, `desginated_facility`, `us_dot`, `quantity`, `wast_code`,`offerers_name`, `manifests` FROM `companies` WHERE quantity='$qu'
$search is made with this script:
for ($i = 0; $i < $count; $i++) {
$search = $search . $find[$i];
}
And the $find array is set using:
if (!empty($_POST['quantity'])) {
if ($count == 0){
$find[$count] = " quantity='\$qu'";
$qu = mysqli_real_escape_string($dbc, trim($_POST['quantity']));
$count ++;
}else{
$find[$count] = " AND quantity='\$qu'";
$qu = mysqli_real_escape_string($dbc, trim($_POST['quantity']));
$count ++;
}
}
There is one of these for each search option.