Posts: 1,050
Threads: 153
Joined: Mar 2016
Reputation:
0
guys. i got a problem with mysql.it gives error invalid default value for "id" and invalid default value for "birthdate" the default value of id is set to none and brithdate's default value to 000-00-00. any idea to fix it?
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Set auto increment for "id" column so it will generate the unique number itself when not specified or set as NULL in an INSERT query (make sure it is also set as PRIMARY KEY).
What data type "birthdate" is? If it is set for example as integer (int), it won't let you create the table and give you error #1067 because the default value '0000-00-00' is invalid. The data type would have to be set as DATE for it to work.
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Can you post the CREATE TABLE query? The problem might also be with sql modes (NO_ZERO_IN_DATE or NO_ZERO_DATE) for 5.7 mysql version.
Posts: 1,050
Threads: 153
Joined: Mar 2016
Reputation:
0
how to edit the table ._. ? Newbie :v and im using a database not created by me
Posts: 1,050
Threads: 153
Joined: Mar 2016
Reputation:
0
Its in "accounts" table's columns. Now what should be the cmd to execute?
Posts: 1,050
Threads: 153
Joined: Mar 2016
Reputation:
0
BirthDate` date NOT NULL DEFAULT '0000-00-00',
?