Cakephp 多选错误

Cakephp 多选错误,cakephp,cakephp-2.0,Cakephp,Cakephp 2.0,尝试保存时出现以下错误 SQL Query: INSERT INTO `table`.`users` (`username`, `password`, `group_id`, `applications`, `modified`, `created`) VALUES ('asdasd', '23ad37a839e26fc46a1f6640861a47305aea5d46', 3, Array, '2012-04-03 02:12:19', '2012-04-03 02:12:19') 下面是多

尝试保存时出现以下错误

SQL Query: INSERT INTO `table`.`users` (`username`, `password`, `group_id`, `applications`, `modified`, `created`) VALUES ('asdasd', '23ad37a839e26fc46a1f6640861a47305aea5d46', 3, Array, '2012-04-03 02:12:19', '2012-04-03 02:12:19')
下面是多个select的代码

echo $this->Form->input('User.applications',array('options'=>$options,'multiple'=>'multiple'));
并调用add方法,即:

if ($this->request->is('post')) {
                                //debug($this->request);exit;   
                                $this->User->create();
                                if ($this->User->saveAll($this->request->data)) {
                                    $this->Session->setFlash(__('The user has been saved'));
                                    $this->redirect(array('action' => 'index'));
                                } else {
                                    $this->Session->setFlash(__('The user could not be saved. Please, try again.'));
                                }
                            }
                            $groups = $this->User->Group->find('list');
                            $this->set(compact('groups'));
谢谢

用这个解决了它

public function add() {
                            if ($this->request->is('post')) {

                                if(count($this->request->data['User']['applications'])){
                                    $this->request->data['User']['applications'] = implode(",", $this->request->data['User']['applications']);
                                }
                ....

这是可行的,但请记住,搜索或加入该专栏是很困难的。理想情况下,您应该使用单独的表和模型来管理每个用户的多个应用程序。