location_ip is NULL

Hello,

i’m using only the piwik database and writing a small user interface. I tried to get the ip addresses via

SELECT inet_ntoa( conv( hex( `location_ip` ) , 16, 10 ) ) AS ip FROM `piwik_log_visit`

My problem is, that most of the ip addresses are NULL. I read some articles and found out, that these are IPv6 addresses.

My question ist, how can i convert those to an readable format in the query. It’s important that i do it with Mysql and not within php.

Thanks a lot

I’m not sure on this one, since we use php to convert the raw binary to ipv6. Maybe search on startpage.com for such feature in mysql?

if you find it would be very interesting to know how to, and if you send me info I could update this faq,

do you know how the IPv6 addresses are saved in the table? Also with

UNHEX( CONV( inet_aton( ipaddress ) , 10, 16 )

?

edit: or how do you extract the ip address with php?