Wednesday, June 24, 2009

Simple SQL UPDATE question

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: