area codes by location :
$strSQL = "SELECT * FROM thecodes WHERE city LIKE '".$letter."%' ORDER BY city LIMIT $offset, 40";
$result = @mysql_query($strSQL) or die("Invalid Query: ".mysql_error());
if(mysql_num_rows($result) > 0) {
$i=0;
while($objRS = mysql_fetch_array($result)) {
//MOD REWRITE AMEND
//*\/:?<>|
$strTheLink = 'http://www.everyareacode.com/';
$strCity = str_replace(" ","-",$objRS["city"]);
$strCity = str_replace("/","-",$strCity);
$strCity = str_replace("\\","-",$strCity);
$strState = str_replace(" ","-",$objRS["state"]);
$strState = str_replace("/","-",$strState);
$strState = str_replace("\\","-",$strState);
$strCounty = str_replace(" ","-",$objRS["county"]);
$strCounty = str_replace("/","-",$strCounty);
$strCounty = str_replace("\\","-",$strCounty);
$strTheLink .= $strCity . '-';
$strTheLink .= $strCounty . '-';
$strTheLink .= $objRS["id"];
$strTheLink .= '-area-code-';
$strTheLink .= $objRS["areaCode"];
$strTheLink .= ".html";
echo '';
echo $objRS["city"];
echo ', ';
echo $objRS["county"];
echo ', ';
echo $objRS["state"];
echo '!';
echo ' ';
}
$i++;
if($i==40) {
ob_flush();
flush();
$i=0;
}
}
else {
echo "No Zip Codes Found! Try Again!";
}
?>
if($offset > 0) echo 'Previous Ares Codes - ';
$strSQL2 = "SELECT * FROM thecodes WHERE city LIKE '".$letter."%' ORDER BY city";
$result2 = @mysql_query($strSQL2) or die("Invalid Query: ".mysql_error());
$numRecords = mysql_num_rows($result2);
if($numRecords > $offset)
{
echo 'Next Area Codes';
}
?>
|