$sql = "update board set hit = hit + 1 where no = '$no' ";
$this->db->query($sql);
//이렇게 하면 안되네요. ㅎㅎ
$data = array(
'hit' =>hit+1
);
$this->db->where('no', $this->seg_value('no'));
$this->db->update('board', $data);
그냥 무식하게 하면 잘되는데요.
ci에서 제공하는 형태로 하려니까 힘드네요... ㅎㅎㅎ
Use of undefined constant hit - assumed 'hit'
이런 오류가 나네요.
답변 주시면 감사하겠습니다.
$this->db->set('hit', 'hit+1', FALSE);
$this->db->update('board');
역시...좋네요 ^^;