加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Codeigniter活动记录:大于语句

发布时间:2020-12-13 13:52:01 所属栏目:PHP教程 来源:网络整理
导读:我正在尝试将“大于”where语句转换为CI的Active Record语法.当我使用这个代码段 $this-db-join('product_stocks',"product_stocks.size_id_fk = product_attributes.id","left"); $this-db-where('product_stocks.stock_level',' 1'); $result = $this-db-g
我正在尝试将“大于”where语句转换为CI的Active Record语法.当我使用这个代码段
$this->db->join('product_stocks',"product_stocks.size_id_fk = product_attributes.id","left");
    $this->db->where('product_stocks.stock_level','> 1');      
    $result = $this->db->get('product_attributes')->result_array();

然后打印$this-> db-> last_query();显示WHEREproduct_stocks.stock_level =’> 1’当然不正确.这可以做吗

我认为这应该是诀窍:
$this->db->where('product_stocks.stock_level >','1');  //moved the >

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读