개발 Q&A

제목 try/catch
글쓴이 앙마 작성시각 2014/03/13 09:28:44
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 15527   RSS
 
try {
            // 유저 아이디와 비밀번호가 맞는지 확인하는 구간
            $userChk = $this->loginmodel->userLogin($userId, $userPass);
            if($userChk != null){
                $userInfo = array(
                       'userId' => $userChk->TC_ID,
                       'userName' => $userChk->TC_NM
                    );
                $this->session->set_userdata($userInfo);
                // 로그인 성공시 status값 0으로 초기화
                $this->loginmodel->statusInit($userId);

                $this->load->view('/WEB_TEACH/head.php');
                $this->load->view('/WEB_TEACH/login/loginSuccess.php');
                $this->load->view('/WEB_TEACH/footer.php');
            }else{
                // 로그인 실패 시 입력받은 사원아이디가 존재하지 않은지 확인하는 구간
                $userExist = $this->loginmodel->userIdCheck($userId);

                if($userExist != null){
                    // 사원 아이디가 존재할 때 비밀번호가 틀렸을 경우 status 증가
                    $this->loginmodel->userPasswordError($userId);                
                }
                $this->load->view('/WEB_TEACH/head.php');
                $this->load->view('/WEB_TEACH/error.php');
                $this->load->view('/WEB_TEACH/footer.php');
            }
        }catch (MySQLDuplicateKeyException $e) {
            echo $e->getMessage();
        }catch (MySQLException $e) {
            echo $e->getMessage();
        }catch (Exception $e) {
            echo $e->getMessage();
        }

php try/catch는 처음 써보는데요

java랑 비슷하기는 한데 제대로 기동되는지 확인해보기 위해서 에러를 내보려 했습니다

없는 테이블로 select 조회를 시켰는데 그냥 ie 에러페이지 형태에서 db에러났다고 뜨네요ㅜㅡ

db는 mysql을 사용중인데 어떻게 수정해야 할까요?

아니면 제가 에러를 잘못 낸 것인가요?



 다음글 지난번에 질문드렸던 댓글입력에 관해.. (2)
 이전글 ckeditor질문입니다 (3)

댓글

들국화 / 2014/03/13 12:03:55 / 추천 0
변종원(웅파) / 2014/03/13 13:08:24 / 추천 0
database.php에서 mysql_debug 확인. ^^