如何仅更新my_field
?
$this->db->set('my_field', 'my_field+1', FALSE);
$this->db->where('my_other_field', 'test');
$this->db->update('my_table');
答案 0 :(得分:0)
尝试这样,
$data['my_field'] = "value";
$this->db->where("");//where condition here
$this->db->update("tablename",$data);
或一线解决方案,
$this->db->update('tablename', $data, "where condition");
修改强>
$this->db->query("update my_table set my_field = my_field + 1 where my_other_field = test");
答案 1 :(得分:0)
{{1}}