Re: The right way to save updated Database Entry

2010-02-21 Thread WebbedIT
DOH!, spotted one mistake in his code, but missed that glaring one, lol. Setting validation to false may allow the data to save, but if you have set validation rules and the data is failing then you do not want it to save. You should be submitting valid data otherwise what's the point in having t

Re: The right way to save updated Database Entry

2010-02-21 Thread amarradi
The solution is the validation :-) save(array $data = null, array $params = array()) $params = array ('validate' => false, 'fieldList' => array (), 'callback' => true); so is it runable ;) Thanks a lot Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakeP

Re: The right way to save updated Database Entry

2010-02-21 Thread amarradi
is it posible that the values will not be save because the model validates this fields so that the field couldn't be reset var $validate = array( 'wishlist_id' => 'numeric', 'title' => 'notempty', 'reservation_email' => 'email' ); Check out t

Re: The right way to save updated Database Entry

2010-02-21 Thread amarradi
Hello, thanks for your code. This way doesn't work. Is my first way not the same like your, but only with an array in the save () - Action. I don't know what is wrong. My Problem is that my way only sets the status in the dataset but no other value Do you have any ideas? The reject-action works

Re: The right way to save updated Database Entry

2010-02-21 Thread John Andersen
WebbedIT got the right answer, just with some missing detail :) The solution missed that the values to be assigned in an array must use => ! So here the corrected solution: [code] $this->WishlistEntry->read(null, $entryId); $this->WishlistEntry->set(array( 'reservation_status' => 'FREE', 're

Re: The right way to save updated Database Entry

2010-02-21 Thread amarradi
Thanks, This way also doesn't work. But why? I tested it in some ways. I dont't know why the reject Action works only with the status field. i should post my sourcecode here of this action. The commented area is the code which allows to set the status free. The problem is, that this code only work

Re: The right way to save updated Database Entry

2010-02-21 Thread WebbedIT
OK, apologies for redirecting you to the cookbook when your initial entry had followed the structure explained on the Saving Your Data page, it's just I have never used the Model->set method to save things so it looked odd to me. You have taken 1. $this->Post->read(null, 1); 2. $this->Post

Re: The right way to save updated Database Entry

2010-02-20 Thread amarradi
Hello, i tried this way now, but no data will be saved. The Older Version saved the status but not the other values. $this->WishlistEntry->read(null, $entryId); $data = array ( 'WishlistEntry' => array ( 'id' => $entryId

Re: The right way to save updated Database Entry

2010-02-20 Thread WebbedIT
You need to read the following in more detail: http://book.cakephp.org/view/75/Saving-Your-Data Basically your data array must be in the format array( 'ModelName'=>array( 'fieldName1'=>'value', 'fieldName2'=>'value', ... ) ) Check out the new CakePHP Questions site http://cakeqs.

Re: The right way to save updated Database Entry

2010-02-20 Thread amarradi
Thanks for your answer I tried to use an array but the fields will not(!) be saved $this->WishlistEntry->save( array( 'reservation_status' =>'FREE' ,'reservation_email' => null ,'reservation_mail_sent' => nu

Re: The right way to save updated Database Entry

2010-02-20 Thread WebbedIT
Use a data array with the id of the record and the 4 fields you want to update then run a Model->save($data), cake will automagically build a query to only update the fields you have included in the data array. HTH Paul Check out the new CakePHP Questions site http://cakeqs.org and help others w

The right way to save updated Database Entry

2010-02-20 Thread amarradi
Hello together, if have a cakephp software, which sends mail to the user, to activate an account. No great think. And it works. So now the user can diactivate the account The Database will be updated but not all fields only one of four. The reservation_status is right set but the other field are n