I have an ip
table with VARBINARY
fields: ip_start
and ip_end
Now I have a problem,
$ip=('2001:255:ffff:ffff:ffff:ffff:ffff:ffff');
$binary=unpack("A16",inet_pton($ip));
var_dump($binary);
Now, how to store $binary_start
and $binary_end
to ip
table?
Do I need any wrapping of data(such as bin2hex)?
"INSERT INTO `ip_table` (`id`, `binary_start`, `binary_end`) VALUES
(1,".$binary_start.",".$binary_end.");"