UK counties sql list

Discussion in 'Customization & add-ons' started by dan_benhunt, Mar 29, 2011.

  1. dan_benhunt

    dan_benhunt New Member

    Joined:
    Mar 8, 2011
    Messages:
    9
    The default 'state' dropdown for the UK contains a mixture of counties and cities, this seems to be because it is using a list of postal areas, rather than counties.

    It looks like this is taken from amember/sql-states.sql

    which is in the format:

    ('GB-ABD', 'GB', 'Aberdeenshire'),
    ('GB-ABE', 'GB', 'Aberdeen'),
    ... etc.

    Does anyone know where I can find a list of counties in this format, so I don't have to enter them all manually?

    Many thanks
    Dan
  2. dan_benhunt

    dan_benhunt New Member

    Joined:
    Mar 8, 2011
    Messages:
    9
    Couldn't find this anywhere, so I created it myself. Here's the list of the 86 UK counties if anyone else needs it:

    (I replaced the GB list in amember/sql-states.sql and then imported the sql file into my database.)

    ('GB-ABD', 'GB', 'Aberdeenshire'),
    ('GB-AGY', 'GB', 'Anglesey'),
    ('GB-ANG', 'GB', 'Angus'),
    ('GB-ARG', 'GB', 'Argyllshire'),
    ('GB-AYR', 'GB', 'Ayrshire'),
    ('GB-BAN', 'GB', 'Banffshire'),
    ('GB-BED', 'GB', 'Bedfordshire'),
    ('GB-BRK', 'GB', 'Berkshire'),
    ('GB-BRW', 'GB', 'Berwickshire'),
    ('GB-BRE', 'GB', 'Brecknockshire'),
    ('GB-BUC', 'GB', 'Buckinghamshire'),
    ('GB-BUT', 'GB', 'Buteshire'),
    ('GB-CAE', 'GB', 'Caernarfonshire'),
    ('GB-CAI', 'GB', 'Caithness'),
    ('GB-CAM', 'GB', 'Cambridgeshire'),
    ('GB-CDG', 'GB', 'Cardiganshire'),
    ('GB-CAR', 'GB', 'Carmarthenshire'),
    ('GB-CHE', 'GB', 'Cheshire'),
    ('GB-CLA', 'GB', 'Clackmannanshire'),
    ('GB-COR', 'GB', 'Cornwall'),
    ('GB-CRO', 'GB', 'Cromartyshire'),
    ('GB-CUM', 'GB', 'Cumberland'),
    ('GB-DEN', 'GB', 'Denbighshire'),
    ('GB-DER', 'GB', 'Derbyshire'),
    ('GB-DEV', 'GB', 'Devon'),
    ('GB-DOR', 'GB', 'Dorset'),
    ('GB-DUM', 'GB', 'Dumfriesshire'),
    ('GB-DUN', 'GB', 'Dunbartonshire'),
    ('GB-DUR', 'GB', 'Durham'),
    ('GB-ELO', 'GB', 'East Loathian'),
    ('GB-ESS', 'GB', 'Essex'),
    ('GB-FIF', 'GB', 'Fife'),
    ('GB-FLI', 'GB', 'Flintshire'),
    ('GB-GLA', 'GB', 'Glamorgan'),
    ('GB-GLO', 'GB', 'Gloucestershire'),
    ('GB-HAM', 'GB', 'Hampshire'),
    ('GB-HER', 'GB', 'Herefordshire'),
    ('GB-HRT', 'GB', 'Hertfordshire'),
    ('GB-HUN', 'GB', 'Huntingdonshire'),
    ('GB-INV', 'GB', 'Inverness-shire'),
    ('GB-KEN', 'GB', 'Kent'),
    ('GB-KIN', 'GB', 'Kincardineshire'),
    ('GB-KRS', 'GB', 'Kinross-shire'),
    ('GB-KIR', 'GB', 'Kirkcudbrightshire'),
    ('GB-LNK', 'GB', 'Lanarkshire'),
    ('GB-LAN', 'GB', 'Lancashire'),
    ('GB-LEI', 'GB', 'Leicestershire'),
    ('GB-LIN', 'GB', 'Lincolnshire'),
    ('GB-MER', 'GB', 'Merioneth'),
    ('GB-MID', 'GB', 'Middlesex'),
    ('GB-MLT', 'GB', 'Midlothian'),
    ('GB-MNM', 'GB', 'Monmouthshire'),
    ('GB-MON', 'GB', 'Montgomeryshire'),
    ('GB-MOR', 'GB', 'Morayshire'),
    ('GB-NAI', 'GB', 'Nairnshire'),
    ('GB-NFK', 'GB', 'Norfolk'),
    ('GB-NHP', 'GB', 'Northamptonshire'),
    ('GB-NOR', 'GB', 'Northumberland'),
    ('GB-NOT', 'GB', 'Nottinghamshire'),
    ('GB-ORK', 'GB', 'Orkney'),
    ('GB-OXF', 'GB', 'Oxfordshire'),
    ('GB-PEE', 'GB', 'Peeblesshire'),
    ('GB-PEM', 'GB', 'Pembrokeshire'),
    ('GB-PER', 'GB', 'Perthshire'),
    ('GB-RAD', 'GB', 'Radnorshire'),
    ('GB-REN', 'GB', 'Renfrewshire'),
    ('GB-ROS', 'GB', 'Ross-shire'),
    ('GB-ROX', 'GB', 'Roxburghshire'),
    ('GB-RUT', 'GB', 'Rutland'),
    ('GB-SEL', 'GB', 'Selkirkshire'),
    ('GB-SHE', 'GB', 'Shetland'),
    ('GB-SHR', 'GB', 'Shropshire'),
    ('GB-SOM', 'GB', 'Somerset'),
    ('GB-STA', 'GB', 'Staffordshire'),
    ('GB-STI', 'GB', 'Stirlingshire'),
    ('GB-SUF', 'GB', 'Suffolk'),
    ('GB-SUR', 'GB', 'Surrey'),
    ('GB-SUS', 'GB', 'Sussex'),
    ('GB-SUT', 'GB', 'Sutherland'),
    ('GB-WAR', 'GB', 'Warwickshire'),
    ('GB-WLO', 'GB', 'West Lothian'),
    ('GB-WES', 'GB', 'Westmorland'),
    ('GB-WIG', 'GB', 'Wigtownshire'),
    ('GB-WIL', 'GB', 'Wiltshire'),
    ('GB-WOR', 'GB', 'Worcestershire'),
    ('GB-YOR', 'GB', 'Yorkshire'),
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Thanks for the info we will update this list!
  4. rajoycer

    rajoycer New Member

    Joined:
    Nov 16, 2006
    Messages:
    1
    Hi,

    Thanks for providing the list.

    You should also also add the 6 counties of Northern Ireland for the UK though.

    County Antrim
    County Armagh
    County Down
    County Fermanagh
    County Londonderry
    County Tyrone
  5. simonhague1

    simonhague1 New Member

    Joined:
    Jan 17, 2012
    Messages:
    1
    Hi, I have this problem also and I was wondering if there is a simple guide to replacing the county information in the SQL table. Relatively inexperienced....

    Thanks
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,274
    Can you provide a link to latest valid list? I will update this so future releases will include full list as well.

Share This Page