MySQL Error
#1

Hello there.

I'm running script which I downloaded but I have problem. After I type my password to register nothing happens, only the chat appears. When I checked in the console I got error -
PHP код:
DescriptionIncorrect date value'0000-00-00' for column 'BirthDate' at row 1 (index 0). Query
In the MySQL database the code for this 'BirthDate' is
PHP код:
`BirthDatedate NOT NULL DEFAULT '0000-00-00'
How I can fix this, because I can't register into the server, after I type the password I should be taken to choose my date of born.
Reply
#2

Anyone?
Reply
#3

Disable NO_ZERO_DATE sql mode in my.ini/my.cnf
Reply
#4

I suggest declaring as as varchar in database & transform in date after fetching it from db.
Reply
#5

It might be "NO_ZERO_IN_DATE" is set in your config, not allowing zero date values. You could change your config, use the default value of NULL (if the column is nullable) or use the unix epoch instead.

Quote:
Originally Posted by iLearner
Посмотреть сообщение
I suggest declaring as as varchar in database & transform in date after fetching it from db.
Please don't do this
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Disable NO_ZERO_DATE sql mode in my.ini/my.cnf
Quote:
Originally Posted by ikkentim
Посмотреть сообщение
It might be "NO_ZERO_IN_DATE" is set in your config, not allowing zero date values. You could change your config, use the default value of NULL (if the column is nullable) or use the unix epoch instead.



Please don't do this
I still have the same problem. I'm not sure if I disabled NO_ZERO_DATE.

This is how I disabled it. I entered my.ini, then found line with
PHP код:
;sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
And changed it to
PHP код:
;sql-mode="" 
Is that the correct way to disable it?
Reply
#7

Thanks for the support guys. You're right, I just forgot to remove ; in front of sql-mode="".
Everything is working now. Hope you have great day.
Reply
#8

Quote:
Originally Posted by SelfiMaster
Посмотреть сообщение
I still have the same problem. I'm not sure if I disabled NO_ZERO_DATE.

This is how I disabled it. I entered my.ini, then found line with
PHP код:
;sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
And changed it to
PHP код:
;sql-mode="" 
Is that the correct way to disable it?
I think you are meant to remove NO_ZERO_DATE only, not the whole configuration.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)