更新时间:2023-02-08 17:09:15
我发现的一个解决方案是完全删除连接并将连接条件移动到 'where' 函数中,您还需要将更新字符串更改为包括新表.
One solution I have found is to remove the join altogether and move the join condition into a 'where' function, also you will need to change the update string to include the new table.
$this->db->set('a.firstname', 'Pekka');
$this->db->set('a.lastname', 'Kuronen');
$this->db->set('b.companyname', 'Suomi Oy');
$this->db->set('b.companyaddress', 'Mannerheimtie 123, Helsinki Suomi');
$this->db->where('a.id', 1);
$this->db->where('a.id = b.id');
$this->db->update('table as a, table2 as b');