db->where_not_-6ren">
gpt4 book ai didi

php - ""哪里不为空

转载 作者:行者123 更新时间:2023-11-30 01:01:19 25 4
gpt4 key购买 nike

我正在尝试使用 CI 编写语句,但在编写 WHERE is not = ""

时遇到问题

能给我一个到目前为止的例子

$empty = array('');
$this->db->where_not_in("$this->_table['shop_shipping_rules']}.shop_shipping_rule_name", $empty);

最佳答案

使用简单的 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();

或者

$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();

Active Record Class

Mysql TRIM()

关于php - ""哪里不为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20105084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com