我想通过向数据库字段添加一些值来增加数据库列中的现有值?在通常的SQL查询中,我们可以这样做:
UPDATE user_master SET votes = votes + 1234 WHERE id = 1000;
字符串
但我想知道如何在传递给updateBatch方法的数据数组中执行此操作
我试着像:
$array['id'] = 1000;
$array['votes'] = 'votes' + 1234;
$builder = $this->db->table('user_master');
$builder -> updateBatch($array, 'id');
型
1条答案
按热度按时间lztngnrs1#
基于Codeigniter 3官方文档
你可以试试这个,我从来没有试过:
字符串