我已经在我的表属性中添加了一个新列,它已经有(id,form_id(外键),类型,标签,大小,序列号,instr)其中instr是我添加的新列.
我的应用程序在CakePHP和MySQL中.
我已经使用以下代码插入表中的属性但是单独的字段instr没有插入.
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);
}
Run Code Online (Sandbox Code Playgroud)
请建议我..