Field 'Ammo1' doesn't have a default value (index 0). Query:
#1

I have insert new field to database in Navicat.
And It's working when account already had in navicat, the ammo is have when player quit game. But error happen with player who want to register account.
And there some error when player register account. There're some line error in serverlog.txt. Here's the error.
PHP код:
[15:14:32] [MySQLQuery Error - (ErrorID1364) (Handle1)
[
15:14:32] [MySQLCheck mysql_log.txt to review the query that threw the error.
[
15:14:32Dumping query from 2015/12/20 (15:14:32)
DescriptionField 'Ammo1' doesn't have a default value (index 0). Query:
[15:14:32] INSERT INTO `accounts` (`RegiDate`, `LastLogin`, `Username`, `Key`) VALUES (NOW(), NOW(), '
Ploy_Register','A72EDBDC3E66DC3F0F84500C4A0DF1AB640F47E95AE4E7C76DE3398854146F33FCABE0A9861A6896D9A78C15273F2C1996E88B14E92A99D4B883AF9A5C98C9C6')
[15:14:43] [part] Ploy_Register has left the server (0:1) 
You can watch this video
https://www.youtube.com/watch?v=s2n_...ature=*********
Reply
#2

Explanation of the error: A value is missing when a new row to be inserted does not contain a value for a non-NULL column that has no explicit DEFAULT clause in its definition.
So, the field Ammo1 is set to not NULL, and you need to insert a value.

You can one of three things:
-Set a default value for that field in your DBMS (empty string ("") or 0)
-Change the field to allow NULL
-Set the sql-mode in my.ini to NO_ENGINE_SUBSTITUTION (but it's better to choose one of the above)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)