SA-MP Forums Archive
MySQL Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Error (/showthread.php?tid=631343)



MySQL Error - SelfiMaster - 27.03.2017

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.


Re: MySQL Error - SelfiMaster - 27.03.2017

Anyone?


Re: MySQL Error - Konstantinos - 27.03.2017

Disable NO_ZERO_DATE sql mode in my.ini/my.cnf


Re: MySQL Error - iLearner - 27.03.2017

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


Re: MySQL Error - ikkentim - 27.03.2017

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


Re: MySQL Error - SelfiMaster - 27.03.2017

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?


Re: MySQL Error - SelfiMaster - 27.03.2017

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.


Re: MySQL Error - Unte99 - 27.03.2017

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.