Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Raw CSV data is made available by Common Data Hub here:
http://www.commondatahub.com/live/geography/state_province_region/iso_3166_2_state_codes
http://www.commondatahub.com/live/geography/country/iso_3166_country_codes
The table cdh_state_codes (see cdh-schema.sql below) is designed to hold the raw data, which should import readily using most common database tools, or directly into MySQL via LOAD DATA, e.g.:
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE iso3166.cdh_state_codes;
| <?php | |
| require_once(__DIR__ . '/inc/config.php'); | |
| /*-------------------------------------------------- | |
| init | |
| --------------------------------------------------*/ | |
| $total_rows = 0; | |
| $response = array(); | |
| $query_city_id = !empty($_GET['city_id']) ? $_GET['city_id'] : 0; |