On May 12, 11:27 am, Master Ram <[email protected]> wrote:
> HI.. All i ma new for cakephp
>
> my table fields are: promoter_id, agency_id, name, surname, ect..
>
> i am fetching the existing data form the table. i am not able to edit
> the data.
>
> this edit code: in the controller:
>
> function edit($promoter_id=null) {
>       if (!$promoter_id && empty($this->data)) {
>          $this->Session->setFlash('Invalid Book', true);
>          $this->redirect(array('action'=>'promoter'));
>       }
>       if (empty($this->data)) {
>          $this->data = $this->Promoter->read(null, $promoter_id);
>       }
>       else {
>          $this->Promoter->create();
>          if(!!$this->Promoter->save($this->data)) {
>             $this->Session->setFlash('Book is Updated!', true);
>             $this->redirect(array('action'=>'promoters_step_two'),
> null, true);
>          }
>       }
>    }
>
> this is my view code:
> $promoter_id=array();
>                                  $agency_id=array();
>                                  $name=array();
>                                  $surname=array();
>
> $x=0;
>                                  foreach( $clockOutChecks as
> $clockOutCheck ) {
>                                       echo  $promoter_id[$x]=
> $clockOutCheck['Promoter']['promoter_id'];
>                                       echo  $agency_id[$x]=
> $clockOutCheck['Promoter']['agency_id'];
>                                       echo  $name[$x]=
> $clockOutCheck['Promoter']['name'];
>                                       echo  $surname[$x]=
> $clockOutCheck['Promoter']['surname'];
>
> e($form->create('Promoter', array('action' => 'promoters_step_two',
> $promoter_id)));
>
>                                  
> e($form->text('promoter_id',array('value'=>$promoter_id[0])));
>
>                                  
> e($form->text('agency_id',array('value'=>$agency_id[0])));
>
>                                  e($form->text('name',array('value'=>
> $name[0])));
>                                  e($form-
>
> >text('surname',array('value'=>$surname[0])));
>
> these are the new fields i want to add form same promoter_id.
>
> e($form->text('top_size'));
>                                 e($form->text('pants_size'));
>                                 e($form->text('bra_size'));
>                                 e($form->text('shoe_size'));
>                                 e($form->text('hair_colour'));
>                                 e($form->text('eye_colour'));
>
>                                 e($form->submit('next >'));
>                                 e($form->end());
>
> where i did the mistake..

Is it .... that the code in the wrong color?

http://catb.org/~esr/faqs/smart-questions.html#beprecise

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 [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

Reply via email to