gpt4 book ai didi

mysql - 为什么在 CakePHP 的查询结果中没有出现新的表列?

转载 作者:可可西里 更新时间:2023-11-01 07:03:08 24 4
gpt4 key购买 nike

我在我的表属性中添加了一个新列,该列已经具有 (id , form_id(foreign key),type,label,size,sequence no,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);
}

请建议我..

最佳答案

关于你的表结构的信息可能被缓存了。去掉“app/tmp/cache/models”的内容再试。

关于mysql - 为什么在 CakePHP 的查询结果中没有出现新的表列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1000365/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com