function ip_tracker_ip_user_count in IP address manager 7.2
Same name and namespace in other branches
- 8.2 ip.module \ip_tracker_ip_user_count()
- 6 ip.module \ip_tracker_ip_user_count()
- 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()
- IpUserCountField::render in src/
Plugin/ views/ field/ IpUserCountField.php - Render the field.
File
- ./
ip.module, line 126 - 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;
}