This week (29 jan 2013), I still work in my current project with cakephp framework.
Today I find small problem but I will always share with you guys. I work on I called view counter, where if there any client view detail of any property in my site, it will update field count in database +1.
Maybe it look easy if we do with php and sql. But how we can do it with cakephp framework?
I'm googling, and found this code below:
$this->Article->updateAll(
array('Property.count' => 'Property.count + 1'),
array('Property.id' => 5)
);
Hope it can help,
But if you still have any question, write your comment below.
Kind regard,
Bayu Prawira
No comments:
Post a Comment