Re: Update field in associated model???
I see, then updateAll() is the method that you want.
It appears by the error message that it's thinking that 'jap' is a field, so maybe it's just in the wrong place? or maybe you have a comma instead of a double arrow?
I ran a little test on my Cake 1.3 install and it worked as expected. Here is the code that I used:
$update = $this->Model
->updateAll(
array('field_name'=>"'text_value_to_save'"),array('Model.field_name_for_where'=>'value_for_where')
);
The only thing that I had a hiccup with was the single quotes around the value to set... because it will pass in the raw value of what ever you tell it to update, so you have to signify it it's text or not.
Other than that... the first array is the SET portion, and the second array is the WHERE portion.
Happy Coding!
-- 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home