My mistakes

cakephp Loops and save()

Posted on: December 29, 2009

Loops and save()

You must reset the Model on every loop iteration.
$this->{ Model Name } ->create();

Place the above line at the beginning of the loop for eg:

foreach() {
$this->{ Model Name } ->create();
/* actual code */
}

Replace the { Model Name } with the corresponding model name

Advertisements
Tags:

1 Response to "cakephp Loops and save()"

as for me codeigniter so better…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: