yii2判断数据库字段不为空

yii2判断数据库字段不为空,第1张

yii2判断数据库字段不为空

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判断数据库字段不为空的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/702180.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-23
下一篇 2022-04-23

发表评论

登录后才能评论

评论列表(0条)

保存