0

I have 2 columns, ip_start, ip_start_long

ip_start        |  ip_start_long
------------------------------------
0.255.255.255   |  16777215

I need to convert ip_start (INET_ATON) and copy update to ip_start_long for all rows (1 million rows)

How can I do it in php or phpmyadmin?

1 Answer 1

2

well simple query will do this for you

update table set ip_start_long = INET_ATON(ip_start);
Sign up to request clarification or add additional context in comments.

2 Comments

what if ip is ipv6? ip_start can have ipv4 & 6
you can see here that native support for ipv6 is not added. there is a link there that will take you to some udf functions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.