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);
更多编程相关内容,请关注php中文网编程入门栏目!
以上就是yii2判断数据库字段不为空的详细内容,更多请关注php中文网其它相关文章!
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
- 上一篇:yii如何获取验证码值
- 下一篇:yii中gii如何使用
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论