section of the book. It helped me to solve the issue.
Actually, the problem was within the array format:
There is no need to specify the "Model" in the array. i.e. the correct
array format should be:
$this->data = Array(
Array('office_id' => '7',
'name' => '666', 'description' => 'aaaa1'),
Array('office_id' => '7',
'name' => '222', 'description' => 'bbb1'),
Array('office_id' => '7',
'name' => '333', 'description' => 'ccc1')
);
Thank you very much...
On Nov 6, 12:42 am, Anupom <anupom....@gmail.com> wrote:
> Try saveAll().http://book.cakephp.org/view/75/Saving-Your-Data
>
>
>
> On Thu, Nov 6, 2008 at 11:32 AM, si-mon <sijumo...@gmail.com> wrote:
>
> > Hi...
> > Is it possible to insert multiple records in a single save().
>
> > For example:
> > I need to insert the following array in a single save():
> > $this->data = Array('Model' =>
> > Array(
> > Array('office_id' => '7',
> > 'name' => '666', 'description' => 'aaaa1'),
> > Array('office_id' => '7',
> > 'name' => '222', 'description' => 'bbb1'),
> > Array('office_id' => '7',
> > 'name' => '333', 'description' => 'ccc1')
> > )
> > );
>
> --
> Anupom Syamhttp://syamantics.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment