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

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(), '
[15:14:43] [part] Ploy_Register has left the server (0:1) 
You can watch this video*********

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)

Forum Jump:

Users browsing this thread: 1 Guest(s)