How to store NULL values in datetime fields in MySQL?

后端 未结 8 527
再見小時候
再見小時候 2020-11-29 05:44

I have a \"bill_date\" field that I want to be blank (NULL) until it\'s been billed, at which point the date will be entered.

I see that MySQL does not like NULL val

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 06:19

    I had this problem on windows.

    This is the solution:

    To pass '' for NULL you should disable STRICT_MODE (which is enabled by default on Windows installations)

    BTW It's funny to pass '' for NULL. I don't know why they let this kind of behavior.

提交回复
热议问题