this is my code ......
$user= new user();
$user->id=$this->request->getPost('id');
$user->name=$this->request->getPost('name');
$save=$user->save();
if($save==False){
$emp= new Employee();
$emp->is=$this->request->getPost('id');
$emp->name=$this->request->getPost('name');
$emp->mdn=$this->request->getPost('mdn');
$emp->save();
}
now sometimes i able to save the data in first table but not able to save the data in second table..in that case i want to redo the save option done in the first table.....how to that...as kept uniqueness validator in the first table if iam trying again its is saying that the data is already present as the data already saved in the table. Please help??