[eluser]Michael Wales[/eluser]
Bah - I always forget about the quoting boolean.
Add the following code to your constructor, this will show you the queries CI generates:
Code:
$this->output->enable_profiler(TRUE);
If you look, the query will be wrong. Change the code I gave you to:
Code:
$this->db->set('views', 'views + 1', FALSE);
$this->db->where(array('article_id' => $id));
$query = $this->db->update('views');
By using the set() method and passing the 3rd parameter (FALSE) we can turn off CI's auto-escaping.