2

So I convert the user's IP address [which is pretty much always in ipv4 format] using inet_pton() and then store in it mySQL using binary(16), now when i extract that row/column, and use inet_ntop it creates a different format [and not the regular 192.123.1.0 etc...], such as 4c78:472a::

Why is this? And how can I fix it?

Jer Dev
  • 55
  • 2
  • 8
  • Just a fraction of IPv6 addresses can be directly mapped onto IPv4 addresses. – mario Nov 19 '14 at 23:23
  • This may help: http://stackoverflow.com/questions/14445582/change-ipv4-to-ipv6-string – Fabiano Araujo Nov 20 '14 at 01:01
  • According to the link ^ the ip address is actually that of IPv6 and not IPv4 since the numbers/letters are on the left side of the outputted string, which doesn't make sense to me. – Jer Dev Nov 20 '14 at 01:15

0 Answers0