From: Dan Nelson Date: October 14 2004 4:42am Subject: Re: IP address to searchable number List-Archive: http://lists.mysql.com/mysql/174161 Message-Id: <20041014044237.GC88757@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Oct 13), Scott Haneda said: > Given a IP range such as: > 12.8.197.10 -> 12.8.197.100 > > 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? INTEGER UNSIGNED. Use inet_ntoa() and inet_aton() if the language you're using to insert/query can't convert ip addresses itself. http://dev.mysql.com/doc/mysql/en/Miscellaneous_functions.html#IDX1519 -- Dan Nelson dnelson@stripped