For user login I use Ion_Auth plugin for code igniter. This library stores IP addresses of users in a mysql VARBINARY field.
For a 90.46.67.92 IP address, I can see the data in database like this :
To access this field in my app I use Code Igniter Active Record lib. I saw on SO topics about packing IP address with inet_pton and unpacking with inet_ntop. With the IP address above, inet_ntop gives me a failure due to bad format.
Any idea to :
PS : I use PHP 5.2
THe IP address is passed through bin2hex(inet_pton($ip))
and then saved in db. To retrieve it use
$user = $this->ion_auth->user()->row();
echo inet_ntop($user->ip_address);