Few years ago, when I was still just a newbie in a programming world – I sacrificed one Sunday and wrote an open source MySQL, Firebird, XML, JSON, CSV and YAML generator for custom Countries data, which I have also published on Github. Well actually, at first it was just MySQL generator, but then open source community contributed to it and built a lot of other awesome functionalities – for which I am really grateful and which was also a great experience.
Up until now, code quality of that project was in quite some band shape – mostly because I was not such an expert when I wrote it for the first time.
More than half a year ago, I wanted to try React on a real project, and getCountries was a perfect example. At that point, I started to rewrite the project, and today, after a lot of larger breaks, I finally merged the Pull Request and brought the Reactification process to the end.
Thanks to everyone who helped out (specially zigomir), and feel free to continue to use the project and to contribute to it.
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.
- Handy PHP and MySQL Queries for Developers (dzone.com)
- Trying to translate a MySQL query into a PHP query (stackoverflow.com)
- MySQL ordering results by specific field values (techtalk.virendrachandak.com)
- Open Source Wars (arnoldit.com)