Yii的条件和LT; IS NULL> [英] Yii condition <IS NULL>

查看:758
本文介绍了Yii的条件和LT; IS NULL>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到行通过柱空值?

它不工作:

  $ criteria->条件=''seller_id` IS NULL';
 

解决方案

  $ criteria-> addCondition('seller_id IS NULL');
$数据= MODEL ::模型() - >找到($条件);
 

试过吗? ** seller_id **是对应的字段名的Yii ,它可能不一样在你的数据库中的实际列名。

How to find row by column with null value?

It doesn't work:

$criteria->condition = '`seller_id` IS NULL';

解决方案

$criteria->addCondition('seller_id IS NULL');
$data= MODEL::model()->find($criteria);

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

这篇关于Yii的条件和LT; IS NULL>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆