PHP Classes

mySQL version?

Recommend this page to a friend!

      PHP Classes blog  >  PHP Tutorial to Detec...  >  All threads  >  mySQL version?  >  (Un) Subscribe thread alerts  
Subject:mySQL version?
Summary:mySQL version?
Messages:4
Author:Robert
Date:2015-12-16 15:23:52
Update:2015-12-28 00:54:54
 

  1. mySQL version?   Reply   Report abuse  
Picture of Robert Robert - 2015-12-16 16:15:46
You forgot to mention how to implement this using mySQL.

  2. Re: mySQL version?   Reply   Report abuse  
Picture of Colin McKinnon Colin McKinnon - 2015-12-16 22:41:51 - In reply to message 1 from Robert
The ip2location service is a service provided over HTTP - you don't need a local database. There are other offerings, including that from MaxMind which provide a downloadable database - but the data access is via a custom library, not a standard DBMS.

It is possible to use MySQL to do GeoIP lookups - but due to the nature of IP addresses, you can't use the normal index types - you need to map the 1-dimensional IP address space into the 2-dimensional representation and use the MySQL geospatial indexing. NB its the IP address which is geospatial - not the physical location! I use this, populated with RIPE data to get country level lookups.

  3. Re: mySQL version?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-12-17 00:22:59 - In reply to message 1 from Robert
This version of the IP2Location is based on a geolocation file that you can download. Although you can put it in a MySQL database, querying files directly is much faster.

  4. Re: mySQL version?   Reply   Report abuse  
Picture of Alexander Skakunov Alexander Skakunov - 2015-12-28 00:54:54 - In reply to message 1 from Robert
Yes, it's possible to download their CSV and upload that to your DB. This is not harder than writing a single SQL request. Do you think it's worth an article? I can write it then.