Home >Database >Mysql Tutorial >mysql存储ip_MySQL

mysql存储ip_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:43:54841browse

bitsCN.com 把ip地址存成unsigned int
 
在mysql中
 
查询的时候把一个ip使用INET_ATON()把ip转换成整形,使用INET_NOTA()把整形转换成字符串ip
 
在php中也有这样的函数分别是,ip2long() 和long2ip()
 
数据量很大的话,会检索很快的 bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn