Zip Code mysql db

From: Date: Sun, 14 Apr 2002 06:28:55 +0000
Subject: Zip Code mysql db
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-13082@lists.php.net to get a copy of this message
I need to search for the nearest entity in range of 100?? miles. I have a mysqldump...city table does not have a zip_code field or zip_code_id I would prefer to enter in zip_code either/or by memory or by data input...maybe a zip+4 or foreign. In some tables (city for instance)I would want to use zip_code_id and others I would use zip_code and use info supplied by others or entered by others. is there an option to use: CREATE TABLE zip_code ( zip_code varchar (15) PRIMARY KEY (zip_code) and would this serve as lookup table? Any other comments appreciated I realize I would have to alter the city table shown below. # # Table structure for table 'city, country, state' # 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) 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)CREATE TABLE country ( country_id char(2) NOT NULL, name varchar(50) NOT NULL, PRIMARY KEY (country_id), KEY name (name) Russell Griechen

« previous php.windows (#13082) next »