Re: edit the table data.
Pleased to help. Master Ram - I have seen several posts from you and the answer almost always lies in compliance with standards. If you are new to Cake, why are you not sticking to what works? You are swimming against the tide. Jeremy Burns jeremybu...@me.com On 12 May 2010, at 10:50, Master Ram wrote: > thank u sir its working... now > > On May 12, 2:43 pm, Jeremy Burns wrote: >> 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 >> jeremybu...@me.com >> >> 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 sitehttp://cakeqs.organd 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+unsubscr...@googlegroups.com For more options, visit this group >>> athttp://groups.google.com/group/cake-php?hl=en >> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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+unsubscr...@googlegroups.com For more options, visit this group >> athttp://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 cake-php@googlegroups.com > To unsubscrib
Re: edit the table data.
thank u sir its working... now On May 12, 2:43 pm, Jeremy Burns wrote: > 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 > jeremybu...@me.com > > 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 sitehttp://cakeqs.organd 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+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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+unsubscr...@googlegroups.com For more options, visit this group > athttp://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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: edit the table data.
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 jeremybu...@me.com 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 cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: edit the table data.
you have any sample code. for edit. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: edit the table data.
On May 12, 11:27 am, 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.. 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en