http://www.yiiframework.com/doc/api/CActiveRecord#updateCounters-detail
Is it possible to decrement a counter?
http://www.yiiframework.com/doc/api/CActiveRecord#updateCounters-detail
Is it possible to decrement a counter?
Yes, use negative values.
Doesn’t work. Neither
updateCounters(array(‘voteCount’=>-1), ‘content=:userInput’, array(’:userInput’=>$model->content));
or
updateCounters(array($model->voteCount=>-1), ‘content=:userInput’, array(’:userInput’=>$model->content));
work
Ah, I see another part of my code was effecting this from changing the value.
I have just realised that when that code updates my counter, it updates my timestamp counter too. Is there a way to just update one table entry?
EDIT: it was my mysql settings. I always post too soon and then figure out my problem >.<