Reputation: 21
I'm sorry, but i have a problem on my website when i want to create any account. My error is :
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'guid' at row 1'
And my code is :
$db->query('INSERT INTO accounts (guid, account, pass, level, vip, email, lastIP, question, reponse, pseudo) VALUES ("", "'.$account.'", "'.$pass1.'", "0", "0", "'.$mail.'", "'.$ip.'", "'.$question.'", "'.$reponse.'", "'.$pseudo.'")');
Please help me... Thank you so much, Stackoverflowers :D !
Upvotes: 0
Views: 31976
Reputation: 360
You are trying to insert an empty string into a column that is expecting an integer. You should probably be inserting an integer. Depending on the setup, you might get away with just inserting a 0 or something but since the column is called guid, that would probably break something. Another option would be to omit it entirely and see if it is set automatically.
$db->query('INSERT INTO accounts (account, pass, level, vip, email, lastIP, question, reponse, pseudo) VALUES ("'.$account.'", "'.$pass1.'", "0", "0", "'.$mail.'", "'.$ip.'", "'.$question.'", "'.$reponse.'", "'.$pseudo.'")');
Upvotes: 4