tags:

views:

95

answers:

1

Hi,

I have added a new column to my table Attributes which already has (id , form_id(foreign key),type,label,size,sequence no,instr) where instr is the new column i have added.

My application is in Cakephp and Mysql.    

I have used the following code to insert into the table Attributes But the field instr alone not inserted .



function saveFieldname($data)//from untitledfieldname
{   
    $this->data['Attribute']['form_id'] = $this->find(  'all', array(
                                                        'fields' => array('Form.id'),
                                                        'order' => 'Form.id DESC'
                                                     ));

    $this->data['Attribute']['form_id'] = $this->data['Attribute']['form_id'][0]['Form']['id'];

    $this->data['Attribute']['label'] = 'Label';
    $this->data['Attribute']['size'] ='50';
    $this->data['Attribute']['instr'] ='Fill';

    $this->data['Attribute']['type'] = $data['Attribute']['type'];
    $this->data['Attribute']['sequence_no'] = $data['Attribute']['sequence_no'];

    $this->Attribute->save($this->data);
}

Please suggest me..

+2  A: 

The information about the structure of your table is probably cached. Remove the content of "app/tmp/cache/models" and try it again.

dhofstet
Ya Now i have removed the files in /cache/Models folder now its done.Thank u.
Aruna
Thank you so much, I was beating my head against the wall about this
Glenn Slaven