Condition Yii <IS NULL>

How to find a row by a column with a null value?

Does not work:

$criteria->condition = '`seller_id` IS NULL'; 
+4
source share
1 answer
 $criteria->addCondition('seller_id IS NULL'); $data= MODEL::model()->find($criteria); 

tried this? ** seller_id ** is the name of the mapped column in Yii , it may not be the same as the actual column name in your database.

+15
source

Source: https://habr.com/ru/post/1344238/


All Articles