gpt4 book ai didi

php - 通过查询生成器对两列求和

转载 作者:行者123 更新时间:2023-11-29 22:15:27 24 4
gpt4 key购买 nike

如何在codeigniter中添加数字?下面的代码

$this->db->where(array('is_active' => 1, 'time + duration <=' => time()));
$this->db->update('table', array('is_active' => 0));

将导致:

UPDATE `table` SET `is_active` = 0 WHERE `is_active` = 1 AND `time +` `duration` <= 1436170717

我想要

`time` + `duration`

最佳答案

我在它们之间添加了引号,它起作用了。

$this->db->where(array('is_active' => 1, '\'time\' + \'duration\' <=' => time() ));

关于php - 通过查询生成器对两列求和,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31241053/

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