List:General Discussion« Previous MessageNext Message »
From:Gary Richardson Date:October 14 2004 4:40am
Subject:Re: IP address to searchable number
View as plain text  

It's really easy to do. Store the IP addresses as int's and use the
inet_aton and inet_ntoa functions:

You can actually store them as strings and use the inet_* functions in
your between statements as well.

On Wed, 13 Oct 2004 21:33:32 -0700, Scott Haneda <lists@stripped> wrote:
> Given a IP range such as:
> ->
> I want to store those 2 values in a database, before I insert a new value, I
> would like to test for the new values existence.
> Any idea what I should convert a IP address into in order to be able to
> operate on it with simple greater than, less than and equal to math?
> --
> --
> -------------------------------------------------------------
> Scott Haneda                                Tel: 415.898.2602
> <>                     Fax: 313.557.5052
> <scott@stripped>                          Novato, CA U.S.A.
> --
> MySQL General Mailing List
> For list archives:
> To unsubscribe:
IP address to searchable numberScott Haneda14 Oct
  • Re: IP address to searchable numberGary Richardson14 Oct
  • Re: IP address to searchable numberDan Nelson14 Oct
  • Re: IP address to searchable numberJames Weisensee14 Oct
  • Re: IP address to searchable numberJigal van Hemert14 Oct