It seems that with ActiveRecord it is impossible to increment the value of a field without fetching it first.
Here’s what I’d like to do:
$this->db->set('ViewCount = ViewCount + 1');
But that doesn’t work, the resulting query looks something like this:
UPDATE Forum_Threads SET 'ViewCount = ViewCount + 1' = '' WHERE ThreadId = 1
Is there anyway, with ActiveRecord, to increment a field, without fetching it’s value first ? I don’t need to know the value at all, so SELECTing it first would be a waste of resources.
Do I have to resort to simple_query() ?