I have a Mysql database where i keep dates of the clients orders.
Date is generated by a php function date('Y-m-d')
. Two records in my database have values '0000-00-00'
. One was created by a client from Australia and another by a client from Italy. Other 5000 orders are fine.
My question is how is it possible to generate such date ? Could it be something with individual browser settings ?
Thanks for help
The only reason what i can find is either your client has entered improper date format or he has entered an empty string. Remember the date format in Mysql is yyyy-mm-dd.
I noticed I was having the same exact issue, and it turned out it was simply that I didn't put single quotes around my $date variable when inserting it, thus it was inserting a null or blank value which appeared as 0000-00-00 in the database. Once I put '$date' instead of $date in my insert statement, the value appeared as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With