Your mistake probably lies in your model. You have deviated away from Cake 
standards by naming your primary key 'promoter_id'. That's a bad move - change 
it if you can, otherwise accept a career full of unnecessary challenges (and 
some unsympathetic answers to your self inflicted woes).

You haven't said so, but I presume the table is called 'promoters'? If so, make 
sure you have this line in your Promoter model:

var $primaryKey = 'promoter_id';

In terms of sample code - have you even looked at the guide?

Jeremy Burns
[email protected]


On 12 May 2010, at 10:27, Master Ram 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..
> please help me..
> 
> 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

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