Forum Moderators: coopster
mysql_select_db("d60763712", $con);
if (!isset($_GET['county']) AND !isset($_GET['city']))
{
echo "<h3>SELECT YOUR COUNTY:</h3>";
echo "<ul>";
$result = mysql_query("SELECT DISTINCT county FROM zip_code WHERE state_prefix = 'AR' ORDER BY county");
while($row = mysql_fetch_array($result))
{
$county = $row['county'];
echo "<li><i><a class='countylinks' href='?county=" . $county . "'>" . $county . " <span style='color: #898a8b'>COUNTY</i></span></a><br /></li>";
}
echo "</ul>";
}
if (isset($_GET['county']) AND !isset($_GET['city']))
{
echo "<h3>SELECT YOUR CITY:</h3>";
echo "<ul>";
$county = $_GET['county'];
$result = mysql_query("SELECT DISTINCT city, locationtext FROM zip_code WHERE state_prefix = 'AR' AND county = '$county' AND locationtext != '' ORDER BY city");
while($row = mysql_fetch_array($result))
{
$city = $row['city'];
$locationtext = $row['locationtext'];
echo "<li><i><a class='countylinks' href='?county=" . $county . "?city=" . $city . "'>" . $locationtext . "</a><br /></li>";
}
echo "</ul>";
}
if (isset($_GET['county']) AND isset($_GET['city']))
{
$county = $_GET['county'];
$city = $_GET['city'];
$result = mysql_query("SELECT DISTINCT FROM zip_code WHERE state_prefix = 'AR' AND county = '$county' AND city = '$city'");
while($row = mysql_fetch_array($result))
{
$city = $row['city'];
$locationtext = $row['locationtext'];
$zip_code = $row['zip_code'];
echo "Information about " . $locationtext . " " . $zip_code . "...";
}
}
mysql_close($con);
?>