把IP存储整型

INET_ATON() 将IP转为十进制数字, INET_NTOA()将数字转换为IP。

我们必需要使用UNSIGNED INT,因为 IP地址会使用整个32位的无符号整形。

1 select * 
2 from user
3 where ip
4 between inet_aton('192.168.0.1')
5 and
6 inet_aton('192.168.0.125');



posted @ 2012-02-16 17:07  源来如此  阅读(822)  评论(0)    收藏  举报