yii2判断数据库字段is null,如下:
相关教程推荐:yii框架
示例:
$query = new query; $query->select('id, city,state,studentname') ->from('student') ->where(['isactive' => 1]) ->andwhere(['not', ['city' => null]]) ->andwhere(['not', ['state' => null]]) ->orderby(['rand()' => sort_desc]) ->limit(10);
更多编程相关内容,请关注编程入门栏目!
以上就是yii2判断数据库字段不为空的详细内容。
