"Philip <test>" <[EMAIL PROTECTED]> writes:
> Hello,
>
> I have a feature request: How about adding a built-in function to convert
> IP addresses from strings to "INT UNSIGNED", and another function to
> convert vice versa.
>
> This makes it easier for e.g. people whose web applications log IP
> addresses in MySQL; it is more efficient to store IP addresses as INT
> UNSIGNED than VARCHAR(10). Also, mask operations (e.g. '&' and '|') can be
> performed on INT UNSIGNED.
>
> I have attached two C functions (ip2num to convert from string to unsigned
> long, and num2ip to convert from unsigned long to string) that could be
> used as code if someone decides to make a built-in function for this.
>
> -Philip Mak ([EMAIL PROTECTED])
HI1
Have you taken a look at INET_ATON and INET_NTOA functions ??
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, FullTime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php