如何在变量中获取插入的数据。我已经编写了这段代码:
$data = '';
data['User'] = array(
"name" => $this->request->data['Emp']['name'],
"email" => $this->request->data['Emp']['email'],
"password" => $this->request->data['Emp']['password'],
"role_id" => $this->request->data['Emp']['role_id'],
"ip" => $myIp,
"user_id" => $loggedUser['id'],
"pc_id_user" => $pc_info
);
$this->User->create();
$use = $this->User->save($data['User']);
在这段代码中,我尝试获取变量中的最后一个数据,但我使用了print_r $use
变量不查看任何数据。我找不到此代码中的错误。