Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Cakephp未编辑枚举字段值?_Mysql_Cakephp_Enums - Fatal编程技术网

Mysql Cakephp未编辑枚举字段值?

Mysql Cakephp未编辑枚举字段值?,mysql,cakephp,enums,Mysql,Cakephp,Enums,我试图用cakephp编辑记录,但除了数据类型为enum的列之外,它可以编辑所有内容。我尝试了很多次,但都失败了。我给出了我的代码 if (!empty($this->request->data)) { if ($this->Event->save($this->request->data)) { $this->Session->setFlash(__('The event has been saved')); } else

我试图用cakephp编辑记录,但除了数据类型为enum的列之外,它可以编辑所有内容。我尝试了很多次,但都失败了。我给出了我的代码

if (!empty($this->request->data)) {
  if ($this->Event->save($this->request->data)) {
  $this->Session->setFlash(__('The event has been saved'));
  } 
  else
  {
  $this->Session->setFlash(__('The event could not be saved. Please, try again.'));
  }
}
我的更新查询显示如下内容:

更新<代码>保留<代码>事件<代码>设置<代码>执行者<代码>编号<代码>类别id<代码>=8,<代码>价格乘数<代码>=1,<代码>事件日期<代码>='2014-03-12',<代码>每周重复<代码>='no',<代码>编号<代码>=1,其中<代码>保留<代码>事件<代码>编号<代码>='1'

此处“价格乘数”列未正确更新。
注意:如果我可以像price\u multiplier='1'那样进行查询,那么我的查询将正确更新。我被困在这个问题上了,知道吗

不支持枚举。不要使用它们。您可以改为使用类似的方法。@mark it show 404 error.\u.以前没有见过@mark的方法,并且喜欢有关枚举的邪恶的有趣链接,但是,如果您一直使用枚举,这个助手:对我来说很好(注意文章中对CakePHP 2.x的注释)。