[eluser]Jose Dueñas[/eluser]
Ok,
I forgot to set the third paremeter for the db->set to FALSE in order to escape.
This works:
Code:
$this->db->set('views', 'views + 1',FALSE);
$this->db->where('id', $id);
$this->db->update('articles');
Many hours in the computer, i'm going for a rest.. hehe
Thanks!
[quote author="Jose Dueñas" date="1226628827"]Hi,
I'm not sure what I'm doing wrong, It's something very imple but I don't get it working...
I want to update an existing record in my database:
Code:
UPDATE articles
SET views = views + 1
WHERE id = $id
so I'm doing:
Code:
$this->db->set('views', 'views + 1');
$this->db->where('id', $id);
$this->db->update('articles');
But I only get, the 'views' set to 0.
Thanks,
Jose[/quote]