• Resolved pharaohsvizier

    (@pharaohsvizier)


    I am in need of converting all the ips on the wp_comments table to decimal format, and I was wondering how you would go abouts doing that. I understand that it should be possible on phpmyadmin with a simple query, but I don’t know how to actually write out the query.

    I gathered from the internet that there is a command called ip2long() that should convert it just fine, but I don’t know how to specify that command to the wp_comments; comment_author_IP table.

    Please help!

    PS. I am also in need of help converting the GMT timestamps on the same table (comment_date_gmt) to unix time. I don’t even have a command for it, but it seems people were able to convert unix to the time format that wordpress has, so it must be possible to go the other way around.

    Thank you so much

Viewing 2 replies - 1 through 2 (of 2 total)
  • See the INET_ATON() function here. Since I don’t know exactly what you are trying to accomplish, I can’t suggest a query for you, but hopefully this reference will answer your question.

    Thread Starter pharaohsvizier

    (@pharaohsvizier)

    Thank you so much for the reply. In the end, I exported the thing to excel and imported it again after converting both these aspects with excel. A bit of a long process, but at least it worked. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘MySQL – Convert IP to Decimal’ is closed to new replies.