I have some PHP and MySql code that is giving me a error when performing an insert statement that tries to put "" into a nullable Date field. I believe the code worked in another environment and therefore am wondering if the environments could be different and it is possible to put empty string into the MySql Date field and have it interpreted as NULL.
I am able to use the string "0000-00-00" to insert into my environment and it does create a NULL value in the date column, however "" is not valid.
before inserttrigger. In the trigger code, inspect ifnew.date_column_nameequals an empty string, if yesset new.date_column_name = null;. That's a quick fix on database level. There's no setting on global level that interprets a 0-length string asnull. It would be a disaster if there were.