我正在尝试使用CI编写声明,但我在撰写WHERE is not = " "
我可以举一个例子吗到目前为止
$empty = array('');
$this->db->where_not_in("$this->_table['shop_shipping_rules']}.shop_shipping_rule_name", $empty);
答案 0 :(得分:0)
使用简单的where()
$this->db->where("$this->_table['shop_shipping_rules']}.shop_shipping_rule_name !='' OR
$this->_table['shop_shipping_rules']}.shop_shipping_rule_name IS NOT NULL
");
修改强>
$this->db->select('*');
$this->db->from('mytable');
$this->db->where("shop_shipping_rule_name IS NOT NULL AND shop_shipping_rule_name !=''")
$query = $this->db->get();
OR
$this->db->select('*');
$this->db->from('mytable');
$this->db->where(" TRIM(shop_shipping_rule_name) IS NOT NULL AND TRIM(shop_shipping_rule_name) !=''")
$query = $this->db->get();
答案 1 :(得分:0)
尝试这样的事情:
$this->db->where('field_name IS NOT NULL');
或者这样:
$this->db->where('field_name !=' , '');
答案 2 :(得分:0)
只需将""
与where
$this->db->where("$this->_table['shop_shipping_rules']}.shop_shipping_rule_name !=", "");