[eluser]Ryuuzaki92[/eluser]
you can get the post data and update it like this:
Code:
$query = $this->db->getwhere('posts', array('id' => $post_id));
$row = $query->row();
$row->count_comments++;
$this->db->update('posts', $row, array('id' => $post_id));
but i prefer using SQL for this simple task:
Code:
$this->db->query('UPDATE posts SET count_comments = count_comments + 1 WHERE id = ?', array($post_id));