Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/64.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
Php saveAll($data)出现问题_Php_Mysql_Cakephp - Fatal编程技术网

Php saveAll($data)出现问题

Php saveAll($data)出现问题,php,mysql,cakephp,Php,Mysql,Cakephp,我正在尝试使用我的userscoontrol.php中的以下代码添加一个新用户。适当的代码将放置在所有其他关联文件中 if ($this->User) { // because we like to send pretty mail // Set view variables as normal $this->set('userDetails', $data['User']); if ($this->User->saveAll($data

我正在尝试使用我的
userscoontrol.php
中的以下代码添加一个新用户。适当的代码将放置在所有其他关联文件中

if ($this->User) {
    // because we like to send pretty mail
    // Set view variables as normal
    $this->set('userDetails', $data['User']);

    if ($this->User->saveAll($data)){

        $this->Session->setFlash('User added successfully', 'default', array('class' => 'errMsgLogin'));
        $this->redirect('manageUsers');
    } else {
        echo "not done";
    }
} else {
    // do nothing
}
我测试了每个模块的代码,但在本节中只有一个问题:-

if ($this->User->saveAll($data))
有人能解释一下
saveAll($data)
正确吗


代码不进入本节:(表示条件未得到满足)


我在本节中只有一个问题
-什么问题?另外,请缩进您的代码。您没有说明您遇到了什么问题,也没有说明
$data
来自何处。如果您显示了
$data
的外观,这将非常有用。表示条件未得到满足。。。输入了更多有问题的细节
 if ($this->User->saveAll($data)){

        $this->Session->setFlash('User added successfully', 'default', array('class' => 'errMsgLogin'));
        $this->redirect('manageUsers');
    } else {
        echo "not done";
    }