List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 15 2001 2:12am
Subject:Re: What datatype for an IP Address Field
View as plain text  
At 8:36 PM -0500 9/14/01, Deryck Henson wrote:
>I need to know the type of data to use for me to put in an IP Address.  I
>tried INT and BIGINT.  Neither worked  HELP!  I need this for my database
>bad!

If you expect to represent them in dotted-quad notation, use CHAR(15).
If you want to represent them as integers, you'll need to convert
dotted quad values.  You may find the INET_NTOA() and INET_ATON()
functions helpful for converting back and forth.

http://www.mysql.com/doc/M/i/Miscellaneous_functions.html

>
>- Deryck H
>- http://www.comp-u-exchange.com


-- 
Paul DuBois, paul@stripped
Thread
What datatype for an IP Address FieldDeryck Henson15 Sep
  • Re: What datatype for an IP Address FieldJames Clifford15 Sep
  • Re: What datatype for an IP Address FieldPaul DuBois15 Sep