What is the first line > $this-model = $this->controller->modelName;
supposed to do? I don't think you need that... (or if you think you do, did you try using $this->controller->model->save() ? ) On Jul 3, 7:38 pm, KiANIi <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to save data using $this->modelName->save(data) in a loop > but after the end of each iteration when I'm trying to find the data > that I've inserted I could not find that data. > > Can anyone tell me how i can save data in table in loop. > > the code is: > > $this-model = $this->controller->modelName; > for ($i =0 ; $i<4;$i++) > { > echo 'Iteration # '.$i; > $this->model->save($distributedImp); > $res = $this->model->findAll(); > print_r($res); > } --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---