State of grace…

โ€”

by

in

Below you will find the PHP code to create a table of USA states. Very useful to have. More cool stuff available

-_-_- cut here -_-_-

#
# Table structure for table `statecodes`
#

CREATE TABLE statecodes (
  id tinyint(3) unsigned NOT NULL auto_increment,
  code char(2) NOT NULL default ”,
  state text NOT NULL,
  PRIMARY KEY  (id),
  UNIQUE KEY code (code)
) TYPE=MyISAM;

#
# Dumping data for table `statecodes`
#

INSERT INTO statecodes VALUES (1, ‘AL’, ‘Alabama’),
(2, ‘AK’, ‘Alaska’),
(3, ‘AB’, ‘Alberta’),
(4, ‘AZ’, ‘Arizona’),
(5, ‘AR’, ‘Arkansas’),
(6, ‘BC’, ‘British Columbia’),
(7, ‘CA’, ‘California’),
(8, ‘CO’, ‘Colorado’),
(9, ‘CT’, ‘Connecticut’),
(10, ‘DE’, ‘Delaware’),
(11, ‘DC’, ‘District of Columbia’),
(12, ‘FL’, ‘Florida’),
(13, ‘GA’, ‘Georgia’),
(14, ‘HI’, ‘Hawaii’),
(15, ‘ID’, ‘Idaho’),
(16, ‘IL’, ‘Illinois’),
(17, ‘IN’, ‘Indiana’),
(18, ‘IA’, ‘Iowa’),
(19, ‘KS’, ‘Kansas’),
(20, ‘KY’, ‘Kentucky’),
(21, ‘LA’, ‘Louisiana’),
(22, ‘ME’, ‘Maine’),
(23, ‘MB’, ‘Manitoba’),
(24, ‘MD’, ‘Maryland’),
(25, ‘MA’, ‘Massachusetts’),
(26, ‘MI’, ‘Michigan’),
(27, ‘MN’, ‘Minnesota’),
(28, ‘MS’, ‘Mississippi’),
(29, ‘MO’, ‘Missouri’),
(30, ‘MT’, ‘Montana’),
(31, ‘NE’, ‘Nebraska’),
(32, ‘NV’, ‘Nevada’),
(33, ‘NB’, ‘New Brunswick’),
(34, ‘NF’, ‘Newfoundland’),
(35, ‘NH’, ‘New Hampshire’),
(36, ‘NJ’, ‘New Jersey’),
(37, ‘NM’, ‘New Mexico’),
(38, ‘NY’, ‘New York’),
(39, ‘NC’, ‘North Carolina’),
(40, ‘ND’, ‘North Dakota’),
(41, ‘NS’, ‘Nova Scotia’),
(42, ‘OH’, ‘Ohio’),
(43, ‘OK’, ‘Oklahoma’),
(44, ‘ON’, ‘Ontario’),
(45, ‘OR’, ‘Oregon’),
(46, ‘PA’, ‘Pennsylvania’),
(47, ‘PE’, ‘Prince Edward Island’),
(48, ‘PQ’, ‘Quebec’),
(49, ‘RI’, ‘Rhode Island’),
(50, ‘SK’, ‘Saskatchewan’),
(51, ‘SC’, ‘South Carolina’),
(52, ‘SD’, ‘South Dakota’),
(53, ‘TN’, ‘Tennessee’),
(54, ‘TX’, ‘Texas’),
(55, ‘UT’, ‘Utah’),
(56, ‘VT’, ‘Vermont’),
(57, ‘VA’, ‘Virginia’),
(58, ‘WA’, ‘Washington’),
(59, ‘WV’, ‘West Virginia’),
(60, ‘WI’, ‘Wisconsin’),
(61, ‘WY’, ‘Wyoming’),
(62, ‘NA’, ‘None of These’);