Try this free PHP class (importer for the csv file included) for GeoLite country database:
Databases are better organized and utilize complex queries while flat file is just a file.
Databases are also faster.
my name is Blagoj,
Nice to be here.
Separate names with a comma.