简体   繁体   English

尝试插入IP地址但出现错误

[英]Trying to insert IP address but get an error

I'm trying to insert IP addresses into LastIP(An unsigned integer) 我正在尝试将IP地址插入LastIP(无符号整数)

INSERT INTO user_entry (UPC, StateID, StoreID,CityID,Price,Count,LastIP) VALUES (885909301378,1,1,1,170,0,INET_ATON(127.0.0.1))

Error: 错误:

1064 - You have an error in your SQL syntax; 1064-您的SQL语法有误; check the manual that corresponds to your MySQL server version for the right syntax to use near '.0.1))' at line 1 检查与MySQL服务器版本相对应的手册,以在第1行的'.0.1))'附近使用正确的语法

You need to add quotes: 您需要添加引号:

INSERT INTO user_entry
(UPC, StateID, StoreID,CityID,Price,Count,LastIP) VALUES 
(885909301378,1,1,1,170,0,INET_ATON("127.0.0.1"))

Source: Manual 资料来源: 手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM