Thursday, July 1, 2010

Re: cannot save multiple checkboxes

When you are saving Kattaxonomie in a loop, then you have to use the
create method first.
See http://book.cakephp.org/view/1031/Saving-Your-Data
where you can read about the create method.
Enjoy,
John

On Jul 1, 6:49 pm, Davor Ilic <webfa...@gmail.com> wrote:
> hi i want to save with the for loop why because i don´t know how to save
> this in other why to my DB.
>
> i save it like this:
>
>  for($i=0;$i<$counted_katId;$i++) {
>
> $save_product = $this->Kattaxonomie->save($this->Kattaxonomie->set(array(
>
> 'kat_id' => $this->data['Kattaxonomie']['kat_id'][$i],
>
> 'product_id' => $this->Product->id
>
> )));
>
> }
>
> it works but not well because it saves only the last one...

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: