Re: How can i update a field using a function

2013-04-07 Thread Jonathan Meyer
' = $this-Invite-getDataSource()-expression('NOW()') )); $this-Invite-save(); ~Jonathan On Wednesday, September 7, 2011 2:54:12 AM UTC-4, 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 UPDATE

Re: How can i update a field using a function

2011-09-08 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

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 google-2...@ryandesign.com 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

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

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-saveField('count_login', 'count_login+1

Re: How can i update a field using a function

2011-09-07 Thread Dr. Tarique Sani
://book.cakephp.org/view/1031/Saving-Your-Data HTH Tarique On Wed, Sep 7, 2011 at 12:24 PM, Richard Neil Roque roquerichardn...@gmail.com 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 UPDATE Users SET AGE=AGE+2+3+4

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 UPDATE Users SET AGE=AGE+2+3+4 WHERE id=1??? If you construct