manny
manny

Reputation: 311

Trying to insert IP address but get an error

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

Upvotes: 0

Views: 491

Answers (1)

Pekka
Pekka

Reputation: 449385

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

Upvotes: 5

Related Questions