You are here

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

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

Gets the total count of IP ranges in database.

4 calls to ip2country_get_count()
ip2countryTestCase::setUp in ./ip2country.test
Overrides DrupalWebTestCase::setUp().
ip2countryTestCase::testDBDownload in ./ip2country.test
Tests DB download
ip2countryTestCase::testIPLookup in ./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 194
Determination of user's Country based on IP.

Code

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