开发者

Trying to insert IP address but get an error

开发者 https://www.devze.com 2022-12-19 03:48 出处:网络
I\'m trying to insert IP addresses into LastIP(An unsigned integer) INSERT INTO user_entry (UPC, StateID, StoreID,CityID,Price,Count,LastIP) VALUES (885909301378,1,1,1,170,0,INET_ATON(127.0.0.1))

I'm trying to insert IP addresses into LastIP(An unsigned integer)

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; check the manual that corresponds to your MySQL 开发者_开发技巧server version for the right syntax to use near '.0.1))' at line 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

0

精彩评论

暂无评论...
验证码 换一张
取 消