I have this configuration: MySQL: 5.1.66-0+squeeze1-log, PHP: 5.3.3-7+squeeze15,
I'm working wtih ipv6 address 2001:35c::/40
While I'm manipulating it on php( inet_pton, inet_ntop) it is good, but after I put it into MySQL database (VARBINARY(16) field, it get messed up (200103000000000000000000000000
instead of 2001035c0000000000000000000000). Where could be the problem?
$addr = '2001:35c::/40';
$addr = explode('/', $addr);
$address = $addr[0];
$address = inet_ntop(inet_pton($address));
$sql = "INSERT INTO IPv6 (IP, Mask, Parent_ID) VALUES ('".inet_pton($address)."', '".$addr[1]."', 0)";
$DB=new Database();
$DB->query($sql);
Also i spotted, that where there are 35c
parti in address (ipv6) it get messed up after inserting into MySQL