Hi....
You could imply use the Increment Behavior:

http://bakery.cakephp.org/articles/view/increment-behavior

Femi
yodi wrote:
Hello,

maybe you can use updateAll :
http://book.cakephp.org/view/75/Saving-Your-Data

perhaps it's help.


On Wed, 2009-06-24 at 00:35 -0700, Rangi wrote:
  
Hello,

I've searched the manual and this group for an answer to this but
can't find anything, so wondering if anyone can help.

I'd like to do a query like this:

UPDATE product SET num_ratings = num_ratings + 1;

In CakePHP I can't figure out how to do it in less than 2 queries
(load record to look up num_ratings, increment num_ratings in php,
save record).

Should I just use a custom query for this?

Any help much appreciated,
Rangi
    




  


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to