Sunday, September 27, 2009

Update existing Integers

Hi there,

while developing some sort of app, which needs often to update an
existing databse entry (integer), e.g. "every time guy A enters my
site, guy A s counter gets +1"

Doing this by native SQL Code is very simple "UPDATE entry SET entry =
+ 1" or "entry = entry+1", doing this in Cake seems nearly impossible
for me. Because nothing i did work.

Passing '+1' into the data array, or 'entry + 1' did not work, also
updateAll did not worked with '+1'

Any ideas instead of using model->query() ?
--~--~---------~--~----~------------~-------~--~----~
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: