-2

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.

  • This question appears to be off-topic because it is about finding a list of ZIP codes for New York City – Wooble Sep 17 '13 at 17:19

1 Answers1

0
$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"];
}
Johannes
  • 134
  • 10