Home > Database > Mysql Tutorial > mysql存储ip_MySQL

mysql存储ip_MySQL

WBOY
Release: 2016-06-01 13:43:54
Original
837 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template