title: How do I use MaxMind's Databases in php
body: <p>I downloaded and extracted GeoLite2-City.mmdb, GeoLite2-Country.mmdb. Both are in <code>htdocs\geoip\</code> </p>
  
  <p>Then, I ran this script. Trouble is, how does this thing work? What is <code>require_once 'vendor/autoload.php';</code> supposed to contain? Am I missing anything here. I used to use the older versions of these that came as .dat file, and had no problem with them. These .mmdb ones are a little hard for me to crack. All I'm trying to do is get the Country Code, Country Name and other data to store in a db when a user uses the search tool on a page. How do I get this going?</p>
  
  <p><strong>My test page taken from the site</strong></p>
  
  <pre><code>&lt;?php
  require_once 'vendor/autoload.php'; //What is this supposed to contain?
  use GeoIp2\Database\Reader; // What is this too?
  
  // This creates the Reader object, which should be reused across
  // lookups.
  $reader = new Reader($_SERVER['DOCUMENT_ROOT'].'\geoip\GeoIP2-City.mmdb'); // Where my DB resides
  
  // Replace "city" with the appropriate method for your database, e.g.,
  // "country".
  $record = $reader-&gt;city('128.101.101.101');
  
  print($record-&gt;country-&gt;isoCode . "\n"); // 'US'
  print($record-&gt;country-&gt;name . "\n"); // 'United States'
  print($record-&gt;country-&gt;names['zh-CN'] . "\n"); // '??'
  
  print($record-&gt;mostSpecificSubdivision-&gt;name . "\n"); // 'Minnesota'
  print($record-&gt;mostSpecificSubdivision-&gt;isoCode . "\n"); // 'MN'
  
  print($record-&gt;city-&gt;name . "\n"); // 'Minneapolis'
  
  print($record-&gt;postal-&gt;code . "\n"); // '55455'
  
  print($record-&gt;location-&gt;latitude . "\n"); // 44.9733
  print($record-&gt;location-&gt;longitude . "\n"); // -93.2323
  
  ?&gt;
  </code></pre>