문제

i have a list of zip codes that belongs to the state of NY, i would like to filter them to only show the zip codes belonging to the city of New York. does anyone know what are the zip codes for the city of new york, and/or if there's a programmatic way of finding out if a given zip code belongs to New York city? pref in php. the codes are stored in a mysql database.

도움이 되었습니까?

해결책

$db = new mysqli('localhost', 'NAME', 'PASSWORD', 'DATABASENAME');
if($db->connect_errno > 0){
    die('Unable to connect to database [' . $db->connect_error . ']');
}
$query = "SELECT something FROM zipcodes WHERE zipcode BETWEEN 10000 AND 10163";
$result = mysqli_query($db, $query);
while ($row = mysqli_fetch_assoc($result))
{
      echo "Something =".$row["something"];
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top