[thelist] zip code ?
Russell Griechen
russgri at bellsouth.net
Wed Apr 10 23:28:01 CDT 2002
I'm in over my head here...
Here is a record from a mysqldump:
INSERT INTO city VALUES ( '11520', 'Toccopola', '34.25639', '-89.23556',
'31');
The 11520 is an auto-increment but is lacking a zipcode and it has a
stateid (31)
So How do I get a zip code into this database without hand entry?
and what are the implications of the 9 letter zips ...England and
France comes into play in this database?...and search for adjacent
breeders, hunters is why I need the lats/longs
Below is a skeleton...but I am lacking the zip code component.
By the way I have a zip file of this code.
#
# Table structure for table 'city'
#
CREATE TABLE city (
city_id mediumint(9) DEFAULT '0' NOT NULL auto_increment,
name varchar(75) NOT NULL,
latitude float(7,5) DEFAULT '0.00000' NOT NULL,
longitude float(7,5) DEFAULT '0.00000' NOT NULL,
state_id tinyint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (city_id),
KEY name (name),
KEY latitude (latitude),
KEY longitude (longitude),
KEY state_id (state_id)
);
#
# Dumping data for table 'city'
#
INSERT INTO city VALUES ( '1', 'Akhiok', '56.94556', '-154.17027', '1');
#
# Table structure for table 'country'
#
CREATE TABLE country (
country_id char(2) NOT NULL,
name varchar(50) NOT NULL,
PRIMARY KEY (country_id),
KEY name (name)
);
#
# Dumping data for table 'country'
#
INSERT INTO country VALUES ( 'us', 'United States');
#
# Table structure for table 'state'
#
CREATE TABLE state (
state_id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
abbrev char(2) NOT NULL,
name varchar(30) NOT NULL,
country_id char(2) NOT NULL,
PRIMARY KEY (state_id),
KEY country_id (country_id),
KEY name (name),
KEY abbrev (abbrev)
);
#
# Dumping data for table 'state'
#
INSERT INTO state VALUES ( '1', 'AK', 'Alaska', 'us');
More information about the thelist
mailing list