Storing IP address in MySQL database (IPv4 AND IPv6)

前端 未结 5 2326
时光取名叫无心
时光取名叫无心 2021-02-15 17:54

Ok, now I\'m aware that similar questions have probably been asked a million times but I\'m a real novice at this and I\'d really appreciate your help here.

Basically, I

5条回答
  •  情话喂你
    2021-02-15 18:40

    I use VARBINARY(16) for the data type and use the MySQL function INET_ATON() to insert the IP number (which I later read using the reverse function, INET_NTOA().

提交回复
热议问题