By the way, the CakePHP inflector class knows how to inflect
"agencies" to "agency" and vice versa; no need to use silly made-up
words like "agencie".

On May 11, 9:43 pm, Ambika Kulkarni <[email protected]>
wrote:
> In your view file put the below code n check
>
>  e($form->select('agencyId',
>
>
>
> >                            array(
> >                            'empty' => '-All Suppliers-',
> >                            $agencies),
> >                            null,
> >                            array(
> >                            'id' => 'agency_id',
> >                            'style' => 'width: 50%'),false));
> On Tue, May 11, 2010 at 1:57 PM, Master Ram <[email protected]> wrote:
> > hi.. all
>
> > i am new to cakePHP.
>
> > my table name is : promoters
>
> > in this table i have many tables. when i am selecting the element form
> > the drop down. in the table only storing "0". when i am changing my
> > option also it is storing "0" only..
>
> > this is my. controller code:
>
> > function promoter(){
>
> >        //get all data from supplier table
> >       $agencies = $this->Agencie->find('list',
> >                                           array(
> >                                           'fields' =>
> > array('agency_id','name'),
> >                                                            'order' =>
> >                                                            array(
>
> >                                                                'name
> > ASC')));
>
> >        $this->set('agencies',$agencies);
>
> >        $demographics = $this->Demographic->find('all');
>
> >        $this->set('demographics', $demographics);
>
> >        if (!empty($this->data)) {
>
> >            $this->Promoter->create();
>
> >            $this->data['Promoter']['agency_id'];
>
> >            $this->data['Promoter']['name'];
>
> >            $this->data['Promoter']['last_name'];
>
> >            $this->data['Promoter']['surname'];
>
> >            $this->data['Promoter']['id_no'];
>
> >            $this->data['Promoter']['cell'];
>
> >            $this->Promoter->save($this->data);
>
> >            $this->Session->setFlash('The User has been registered,
> > please login');
>
> >            $this->redirect(array('action'=>'promoters_step_two'));
>
> >        }
>
> >    }
>
> > this is my view code:
>
> > <?php
> >                    e($form->select('agencie_agencyId',
> >                            array(
> >                            'empty' => '-All Suppliers-',
> >                            $agencies),
> >                            null,
> >                            array(
> >                            'id' => 'agency_id',
> >                            'style' => 'width: 50%'),false));
> >                ?>
>
> > table fiels is: agency_id.
>
> > please help me. where i am missing. in this code...
>
> > 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 [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<cake-php%[email protected]>For
> >  more options, visit this group at
> >http://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 [email protected]
> To unsubscribe from this group, send email to
> [email protected] 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 [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