0
나는 users와 employee_personals이라는 두 개의 테이블을 가지고있다. 내가 다음 양식을 제출 employee_personals가 삽입되어 있지만, empty.pls HEL은 user.epf_no 경우 employee_personal data.my 코드를 삽입 할 때 나는 동시에 사용자 테이블 employee_personal.epf_no을 삽입 할cakephp, 동시에 두 테이블에 데이터를 저장하는 방법
if ($this->request->is('post'))
{
$this->EmployeePersonal->create();
$post_data = $this->request->data;
if ($this->EmployeePersonal->save($post_data))
{
$data=$this->request->data['EmployeePersonal']['epf_no'];
if ($this->User->save($data))
{
$this->redirect(array('controller' =>'employee_personals','action'=>'add'));
}
}
$this->Session->setFlash(__('Unable to save personal details'));
}
다음과 같다 나에게 함수를 작성하려면
save() 대신 saveAll()을 사용하십시오. – kicaj