Answer the question
In order to leave comments, you need to log in
How to write NULL to database?
There is a property (field) that has a value, for example, "bla bla bla", under certain conditions, NULL should be written to the database, DEFAULT NULL is set for this field in the database.
when I do , then emptiness or an empty string is written to the database (2 - in the picture), but definitely not NULL :D, but I need exactly NULL (1 - in the picture)
UPD1: this is Yii 2, the ActiveRecord model $model->id_no = null;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question