Re: How can i update a field using a function

2013-04-07 Thread Jonathan Meyer
)->expression('send_count + 1'), 'sent' => $this->Invite->getDataSource()->expression('NOW()') )); $this->Invite->save(); ~Jonathan On Wednesday, September 7, 2011 2:54:12 AM UTC-4, Richard Neil Roque wrote: > >

Re: How can i update a field using a function

2011-09-08 Thread WebbedIT
@Richard: I model-ise my user_visits so I know latest and previous visits etc. and then have a CounterCache on that join. But, this certainly works $this->ShopProduct- >updateAll(array('ShopProduct.view_count'=>'view_count + 1'), array('ShopProduct.id'=>$product['ShopProduct']['id'])); HTH, Paul

Re: How can i update a field using a function

2011-09-08 Thread Dr. Tarique Sani
On Thu, Sep 8, 2011 at 6:14 AM, Ryan Schmidt wrote: > You really do want to be doing it the way the OP said: by running an atomic > UPDATE statement that does the increment directly in the database, not in PHP > code. I'm sure it's easy to do that in CakePHP but I don't have the code > handy; p

Re: How can i update a field using a function

2011-09-07 Thread Richard Neil Roque
Thanks for your reply. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@

Re: How can i update a field using a function

2011-09-07 Thread Ryan Schmidt
On Sep 7, 2011, at 02:38, Dr. Tarique Sani wrote: > On Wed, Sep 7, 2011 at 12:24 PM, Richard Neil Roque wrote: >> >> Hi i'm a new developer using CakePHP. >> I would like to know >> How can i update a field using a function. >> Example is >>

Re: How can i update a field using a function

2011-09-07 Thread Dr. Tarique Sani
;last_login'] = date('Y-m-d H:i:s'); Then just save it Read http://book.cakephp.org/view/1031/Saving-Your-Data HTH Tarique On Wed, Sep 7, 2011 at 12:24 PM, Richard Neil Roque wrote: > > Hi i'm a new developer using CakePHP. > I would like to know > How can

How can i update a field using a function

2011-09-07 Thread Richard Neil Roque
Hi i'm a new developer using CakePHP. I would like to know How can i update a field using a function. Example is UPDATE Users SET AGE=AGE+2+3+4 WHERE id=1??? Currently i do have a code like this one. $this->User->id = $user['User']['id']; $this->User->