You are here

function ip2country_get_count in IP-based Determination of a Visitor's Country 7

Same name and namespace in other branches
  1. 8 ip2country.module \ip2country_get_count()
  2. 6 ip2country.module \ip2country_get_count()

Gets the total count of IP ranges in database.

4 calls to ip2country_get_count()
ip2countryTestCase::setUp in tests/ip2country.test
Overrides DrupalWebTestCase::setUp().
ip2countryTestCase::testDbDownload in tests/ip2country.test
Tests DB download.
ip2countryTestCase::testIpLookup in tests/ip2country.test
Tests IP lookup for addresses in / not in the database.
_ip2country_update in ./ip2country.admin.inc
AJAX callback to update the IP to Country database.

File

./ip2country.module, line 223
Determination of user's Country based on IP.

Code

function ip2country_get_count() {
  $sql = "SELECT COUNT(*) FROM {ip2country}";
  $count = db_query($sql)
    ->fetchField();
  return (int) $count;
}