I want to to update a column value with the current column value plus an increment. My table structure is as follows:
id | menu | priority
__________________________
1 | One | 2
2 | Two | 3
3 | Three | 1
A simple query I have tried that is working:
update table set priority=priority+1 where id=2
in codeigniter:
$update_new_pri=$this->db->where('id',$menu_ids[$i])->update($this->table['menu'],array('menu_priority'=>'menu_priority+1'));
But it's not working.