i have two tables- users and employee_personals. I want to insert employee_personal.epf_no to users table at the same time when inserting employee_personal data.my code is as below
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'));
}
When i submit the form then employee_personals is inserted, but user.epf_no is empty.pls hel me to write the function