[英]How to update database column value with CONCAT() function using codeigniter?
Write now i'm using this query -现在写我正在使用这个查询 -
$this->db->query("UPDATE my_table SET member = CONCAT(member,',',$user_id) WHERE id=$id");
How I convert this query in Codeigniter style, like $this->db->update(...)
我如何以 Codeigniter 样式转换此查询,例如
$this->db->update(...)
Try this but not tested试试这个但未经测试
$this->db->where('id',$id);
$this->db->set('member', 'CONCAT(member,\',\',\''.$user_id.'\')', FALSE);
$this->db->update('my_table');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.