You are here

function ip_tracker_ip_user_count in IP address manager 8.2

Same name and namespace in other branches
  1. 6 ip.module \ip_tracker_ip_user_count()
  2. 7.2 ip.module \ip_tracker_ip_user_count()
  3. 7 ip.module \ip_tracker_ip_user_count()

Count how many users have been tracked against an IP.

1 call to ip_tracker_ip_user_count()
ip_views_handler_field_user_count::render in views/handlers/ip_views_handler_field_user_count.inc

File

./ip.module, line 80
IP address manager module.

Code

function ip_tracker_ip_user_count($ip) {
  $sql = "SELECT COUNT(uid) FROM {ip_tracker} WHERE ip = :ip";
  $args = array(
    ':ip' => ip2long($ip),
  );
  $count = db_query($sql, $args)
    ->fetchField();
  return $count;
}