1
내 영어 죄송에 예외를 잡을 수 없어하지만 난 (내가 삽입 쿼리 내가 3 차 키 테이블 직원당이는 CodeIgniter의
을 잡으려고 노력하고있어 문제가 Matricule을 을 도움이 필요하세요 CIN, 이름)
function insert_Employe($donnees){
try{
$this->db->insert('Employe',$donnees);
return 'employe enregistré avec succes';
}catch(Exception $e)
{
return $e->getMessage();
}
}
내 계속 내가 중복 값
와 새로운 직원당를 추가 할 때내 모델
를 예외를 잡으려면롤러
function nouveau(){
if(!$this->offres->_isLogged() || !$this->input->post('Ajax')==1){
redirect(base_url().'users');
}
$values = $this->_get_values();
try{
$message = $this->employe->insert_Employe($values);
echo $message;
}catch(Exception $e){
echo $e->getMessage();
}
}
나는 예외가 발생하지 않습니다 제외
그래서'$ this-> DB-> 삽입()'당신이 insert_Employe ('에 잡을 예외가 발생) '와 당신은 후자가 예외를 던지지 않는 이유를 궁금해하십니까? – kero
중복 된 값을 삽입 할 때 예외 핸들 문제를 일으키는 중복 된 값을 변경해야한다는 것을 사용자에게 알리기 위해이 예외를 catch합니다. – bouchnina