Hi,
> Under the first note--My english is bad,so say sorry first to every
> member.
>
> ok, I find an eminently case in model method about save data into
> database.
>
> exapmple1
> $this->data=array(
> 'Modelname'=>array(
> 'id' => '123',
> 'somefield'=>0
> )
> );
> $this->Modelname->save($this->data);
>
> so the result in database,value of the field named 'somefield' is 0.
>
> example2
> $this->id=123;
> $this->Modelname->save(array('somefield'=>0));
How about:
$this->Modelname->save(array('Modelname'=>array('id'=>123,
'somefield'=>0)));
If you call save in a loop, on every iteration use $this->Modelname-
>create() as mentioned on:
http://book.cakephp.org/view/75/Saving-Your-Data
Regards,
Piotr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---