Channel Locator Search Results

Channel Locator Search Results


[insert_php]

include_once 'config2018.inc.php';

[/insert_php] [insert_php] $search=$_POST["search"];
//$search = "07006";

if (is_numeric($search)) {
$search= trim($search);
echo " Zip: "."$search
";

$sql = "SELECT DISTINCT name, site, channel FROM company, correspondence, location
WHERE location.zip='$search' and company.companyid=correspondence.companyid
and correspondence.locationid=location.locationid";

$result = $conn->query($sql);

if ($result->num_rows > 0) {
echo "

";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "

";
}
echo "

Company Name Website Channel
".$row["name"]." ".$row["site"]." ".$row["channel"]."

";
} else {
echo " Please recheck your ZIP CODE code or TOWN NAME ";
}
}

else{

if (is_string($search)) {
$search=ucwords($search);
echo " Town: "."$search
";

$sql = "SELECT DISTINCT name, site, channel FROM company, correspondence, location
WHERE location.town='$search' and company.companyid=correspondence.companyid
and correspondence.locationid=location.locationid";

$result = $conn->query($sql);

if ($result->num_rows > 0) {
echo "

";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "

";
}
echo "

Company Name Website Channel
".$row["name"]." ".$row["site"]." ".$row["channel"]."

";
}
else {
echo " Please recheck your ZIP CODE code or TOWN NAME ";
}
}
}

$conn->close();
[/insert_php]

WMBC TV