Php 更新数据库当前字段

Php 更新数据库当前字段,php,mysql,sql,database,codeigniter,Php,Mysql,Sql,Database,Codeigniter,如何仅更新我的_字段 $this->db->set('my_field', 'my_field+1', FALSE); $this->db->where('my_other_field', 'test'); $this->db->update('my_table'); 试着这样, $data['my_field'] = "value"; $this->db->where("");//where condition here $this->

如何仅更新
我的_字段

$this->db->set('my_field', 'my_field+1', FALSE);
$this->db->where('my_other_field', 'test');
$this->db->update('my_table');
试着这样,

$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");
试着这样,

$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");

您在代码中遇到了什么问题???,我的问题是,我不想简化我的\u字段,然后只更新我的\u字段,因为这样我想按('time\u field')排序,当我更新整列“time\u field”时还有更改。对不起,我的英语不好。你想将字段“my_field”增加1吗?是的,只更新“my_field”你在代码中面临的问题是什么?我的问题是,我不想更改my_field,然后只更新my_field,因为我想按('time_field')排序,当我更新整列“time_field”时还有更改。对不起,我的英语不好。你想将字段“my_field”增加1吗?是的,只更新“my_field”,我试过了,但它对我不起作用:/你想将列计数增加1吗?是的,只更新“my_field”否:(在我的表中是字段“id”,“add_time”和“count”,我想增加“count”,其中('id=>my_id)然后只更新“count”。谢谢,我花了这么多时间。你必须增加并只更新count rite>?我试过了,但对我不起作用:/你想将列计数增加1??是,只更新“my_field”否:(在我的表中是字段“id”,“add_time”和“count”,我想增加“count”,其中('id'=>my_id)然后只更新“count”。谢谢,我花了这么多时间。您必须增加并只更新count rite>??