Hi,
I was created in helpers/Functions.php a new function:
function get_location_by_user_ip(): string {
$ip_list = get_user_ip();
$ipArray = explode(",", $ip_list);
$last_ip = end($ipArray);
return substr($last_ip, 0, strrpos($last_ip, '.'));
}
When I created a Query in with this function, in PHPMyAdmin is correct, but in PHPRad list is empty:
"SELECT DISTINCT id AS value, name AS label FROM table WHERE is_true=? AND id=(SELECT DISTINCT country_id FROM ip_addresses WHERE ip_addr LIKE ?)" , array('1',get_location_by_user_ip())