选择DB列是否为空

时间:2013-11-20 18:25:44

标签: php sql codeigniter

我有一个数据库,其列为空且未使用NULL

如果下面的列为空,我该如何选择?

$this->db->where("{$this->_table['shop_shipping_rules']}.shop_shipping_rule_name");

代码:

$this->db->or_where("{$this->_table['shop_shipping_rules']}.shop_shipping_rule_country_iso", NULL);
$this->db->or_where("{$this->_table['shop_shipping_rules']}.shop_shipping_rule_country_iso", $country_iso);
$this->db->or_where("{$this->_table['shop_shipping_rules']}.shop_shipping_rule_region_code", $shop_shipping_rule_region_code);
$this->db->where("{$this->_table['shop_shipping_rules']}.shop_shipping_rule_name");

1 个答案:

答案 0 :(得分:0)

试试这个

$this->db->where("{$this->_table['shop_shipping_rules']}.shop_shipping_rule_name",'');

在Yii和Zend中为我工作..