Mihai
Mihai

Reputation: 79

Illegal double value found during parsing MySql

I get an error when I insert into mysql sever, I searched google and I found out that this error causes by the e in the sql insert statement, how can I fix it? I can't change the e because this is a hw information. Thanks.

INSERT INTO users (username, password, hwid1) VALUES (admin, admin, 455641444542464542464246463030303330364333496e74656c28522920436f726528544d292069372d343739304b20435055204020342e303047487a47656e75696e65496e74656c34303031476967616279746520546563686e6f6c6f677920436f2e2c204c74642e546f2062652066696c6c6564206279204f2e452e4d2e414c41534b41202d203130373230303946484e5649444941204765466f72636520475458203130363020364742);

Upvotes: 2

Views: 5875

Answers (1)

O. Jones
O. Jones

Reputation: 108641

MySQL is trying to interpret your giant hwid value as a number. When you don't tell MySQL what kind of number you have, it uses 64-bit floating point. The letter e, shown just once, is a valid part of a constant.

In your insert, wrap all your text strings -- all your data bound for text-like columns -- in single quotes.

 INSERT INTO users (username, password, hwid1) VALUES ('admin', 'admin', '45544...367742');

Text-like columns include these data types: CHAR, VARCHAR, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.

(Be careful with those plain text passwords, eh?)

Upvotes: 2

Related Questions