#1051 (ok 3.0) IP-address field stored as INT

Alex M.

I have many fields wich stores IP-address as INT as a result of ip2long() function.
Please add a transformation option to view this fields as a normal IPv4 address.


  • Gert Palok

    Gert Palok - 2007-10-12

    Logged In: YES
    Originator: NO

    How do you suppose the column be detected as a network address?
    a) You can't detect it by type - there are far too many uses for UNSIGNED INTEGER
    b) You can't detect it by name - there are far too many variations
    However, the addition of functions INET_ATON and INET_NTOA would be nice

  • Alex M.

    Alex M. - 2007-10-15

    Logged In: YES
    Originator: YES

    For example:

    <?php /* libraries/transformations/text_plain__long2ip.inc.php */

    function PMA_transformation_text_plain__long2ip($buffer, $options = array(), $meta = '') {
    return long2ip($buffer);


    or something like this.

    It would be nice, if you include this feature in the distribution.

  • Gert Palok

    Gert Palok - 2007-10-15

    Logged In: YES
    Originator: NO

    You miss the whole point of my comment... Its easy to convert text to IP and vice versa - both in PHP or using MySQL functions INET_NTOA/INET_ATON

    The point is, which columns to convert and which not
    For example, I might store 4 integers in a VARCHAR column, separated by ".", and they even might be in range 0-255 each, but they are definitely not IP addresses.

  • Sebastian Mendel

    Logged In: YES
    Originator: NO

    @gert_p: transformation is an option in phpMyAdmin that has to be defined for every field, this is not done automatically, so there is no need to guess what fields are long ips and what not - this is defined by the user

  • Alex M.

    Alex M. - 2007-10-19

    Logged In: YES
    Originator: YES

    I understand, it's not a good idea to automatically determine the INT (or other) fields ;)
    It's impossible and I don't suggest to do it.
    I use "transformations" and feel good.
    So, it might be a usefull transformation and I suggest to include it in the PMA package.

  • Sebastian Mendel

    • priority: 5 --> 1
    • assigned_to: nobody --> cybot_tm
    • summary: IP-address field stored as INT --> (ok 3.0) IP-address field stored as INT
    • status: open --> open-accepted
  • James Hanley

    James Hanley - 2008-01-03

    Logged In: YES
    Originator: NO

    There is also the issue of ipv6 which is a 4 long word address. Trying to auto detect if an address is stored as an int just falls apart in this case. There is already the ability to store the meta information about a given database in the phpmyadmin database. IMHO, it would be better to include this information there.

  • KwikOne

    KwikOne - 2008-08-28

    Logged In: YES
    Originator: NO

    I think you still missed the point of this feature request. It is a request to provide a standard transformation in the normal distribution in the same manner as the text/dateformat and etc. transformations which the user then selects for a specified column. No detection of what it is is even necessary since the user is the one who decides to have the transformation applied.

  • Marc Delisle

    Marc Delisle - 2008-09-27
    • status: open-accepted --> closed-accepted
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-accepted --> fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks