Categories
Programming Tech

Countries database table for MySQL


So today, I was buzzing around and searching for a `countries` table script that I could use in MySQL database. As you can imagine, it wouldn’t make any sense to add all world countries into database table one-by-one.

I’ve found few interesting things around there, but all of those solutions were not flexible and were created for individual projects – and when I say that, I mean that some of those tables have only two columns (like country code and country name), some of those have 3 columns, and some of those have bunch of columns (that are probably not useful to many developers).

Anyway, after checking some of those solutions I came to idea that I could make something on my own – something that will be flexible and customizable. And the result was GetCountries “program” where you can select which columns do you want, click “Get it!” and the program will fetch “fresh” results from Geonames API and will generate you a SQL script. After that you can copy/paste that script and eventually change column names.

Hope someone will find that useful.

GetCountries app | code @ Github

18 replies on “Countries database table for MySQL”

Suppose that some developers are using MySQL, some XML, and even some other solution for that things. To be true, I’m still thinking what will I use for my next app – I’ll try to search around for a little bit.

Hi there I am so happy I found your webpage, I really found you
by error, while I was searching on Aol for something else, Anyhow I
am here now and would just like to say thanks for a remarkable post and
a all round interesting blog (I also love the theme/design), I don’t have time
to read through it all at the moment but I have book-marked it and also included
your RSS feeds, so when I have time I will be back to read a lot more, Please do
keep up the great work.

Thank you very much for this script. I have to complete this job in like 30 min and could never accomplish that without your script …. You just made my day a lot better ..
Raj

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.