function hit_update($id=NULL)
{
if (is_null($id)) return NULL;
$this->db->set('hits', 'hits + 1', false);
$this->db->where('id', $id);
$this->db->update($this->board);
return TRUE;
}저는 이렇게 하구 있습니다.그런데 위에 헛발이님이 올리신 저것은 어떤 프로그램으로 캡쳐한거죠?
$this->db->set('reply_count', 'reply_count+1', FALSE);
$this->db->update('mytable', NULL, array('id' => $id));
하거나
$this->db->set('reply_count', 'reply_count+1', FALSE);
$this->db->where(array('id' => $id));
$this->db->update('mytable');
이 방법이 정석이듯 싶군요.
http://codeigniter-kr.org/user_guide/database/active_record.html set()부분 보세요.
insert 부분에 나와있지만 update에도 동일하게 적용됩니다.
$this->db->set('reply_count', 'reply_count+1', FALSE);