【问题标题】:Codeigniter Arithmetic inside of set statementset 语句中的 Codeigniter 算术
【发布时间】:2018-09-09 21:02:31
【问题描述】:

我正在尝试使用来自array key 的值更新表中的字段,下面是语句,但在使用数组键时我无法开始工作。我是新手,可能没有正确创建语句。任何帮助表示赞赏。

$this->db->set('product_qoh', 'product_qoh - $item['sold']' ,FALSE);

【问题讨论】:

    标签: php database codeigniter


    【解决方案1】:

    下面对我有用,上面是用 $item['sold'] 的否定替换单元格值。

    $this->db->set('product_qoh', 'product_qoh - '  .$item['sold'] ,FALSE);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 2017-07-23
      • 1970-01-01
      相关资源
      最近更新 更多