묻고답하기

며칠쨰 끙끙대네요.

 

수동으로 호스팅 DB에 들어가서 레코드를 하나 만든 후에 update함수를 호출하면 update쿼리는 잘 먹는데요.

 

처음부터 인서트 하려고 하면 암만 해보 잘 안되네요. 뭐가 문제일까요? ㅜㅜ

 

참고로 채용모듈을 개조하고 있는 중입니다.

 

또한, 암만 생각해도, 쿼리구문은 제대로 만든것 같거든요.

 

ㅜㅜ 누가 좀 도와주세요.

 

* 불러오는 함수 중 일부

 

            //if is a new comment_srl ,then insert the comment. Or update the comment
            if($comment->comment_srl != $obj->comment_srl) {
                $output = $oCommentController->insertComment($obj, $bAnonymous);
                $comment_srl = $output->get('comment_srl');
    $insert_extravars = $this->insertJudgeOpinion($comment_srl);
    $msg = 'application_success_registed';
            } else {
    $obj->parent_srl = $comment->parent_srl;
                $output = $oCommentController->updateComment($obj);
                $comment_srl = $obj->comment_srl;
    $update_extravars = $this->_updateApplicantExtraVars($comment_srl);
    $msg = 'application_success_updated';
            }


 

* Insert 함수


function insertJudgeOpinion($comment_srl)
        {
            $vars = Context::getRequestVars();
   $args->comment_srl = $comment_srl;
   $args->module_srl = $this->module_srl;
   $args->applicant_name = '이동근'; //strval($vars->applicant_name);
   $args->result = strval($vars->result);
   $args->score1 = strval($vars->score1);
   $args->score2 = strval($vars->score2);
   $args->score3 = strval($vars->score3);
   $args->score4 = strval($vars->score4);
   $args->score5 = strval($vars->score5);
   $args->score6 = strval($vars->score6);
   $args->score7 = strval($vars->score7);
   $args->mention1 = $vars->mention1;
   $args->mention2 = $vars->mention2;
   $args->mention3 = strval($vars->mention3);
   $args->mention4 = strval($vars->mention4);
   $args->mention5 = strval($vars->mention5);
   $args->mention6 = strval($vars->mention6);
   $args->mention7 = strval($vars->mention7);
   $args->comprehensive = strval($vars->comprehensive);

            // $args->birth =  date('YmdHis', strtotime($vars->birthday));
            // $args->phone_no = $vars->phone_number;
   // $diff = abs(time()-strtotime($vars->birthday));
   // $args->age = intval($diff / (365*60*60*24));
   $logged_info = Context::get('logged_info');
            if(!$logged_info) $args->member_srl = 0;
            else $args->member_srl = $logged_info->member_srl;

            $output = executeQuery('paper.insertJudgeOpinion', $args);
   return $output;

   if (!$output) {
     echo("Insert 성공");
             }
             else {
                 echo("Insert 실패");
             }  
    
            $connect = DB::getInstance();
                         
            $query = $connect->_query("INSERT INTO xe_paperrating (comment_srl, module_srl, member_srl, applicant_name, result, score1, score1) value ('123', '2333', '4', 'adsf',
    '10', $args->score1)");
             $result = $connect->_fetch($query);
                         
            return $result; 


/*
   // 직접 제어(XE 인서트 안먹으므로 직접 제어 
   // if (!$output) { 
            require $_SERVER['DOCUMENT_ROOT']."/files/config/db.config.php";
            // $conn = mysql_connect($db_info->master_db['db_hostname'],$db_info->master_db['db_userid'],$db_info->master_db['db_password'])or die(mysql_error());
            // $selc = mysql_select_db($db_info->master_db['db_database'],$conn);
 
            $hostname = "localhost"; // $db_info->master_db['db_hostname']; 
            $username = "kdfs2013"; // $db_info->master_db['db_userid']; 
            $password = "daniel81"; // $db_info->master_db['db_password']; 
            $dbname = "kdfs2013_godohosting_com"; // $db_info->master_db['db_database']; 

            // $conn = mysqli_connect($hostname, $username, $password) or die("MySQL Server 연결에 실패했습니다");
            $connect = mysqli_connect($hostname, $username, $password, $dbname) or die("MySQL Server 연결에 실패했습니다");
            mysqli_set_charset($connect, "utf8");

            $q = "INSERT INTO xe_paperrating (comment_srl, module_srl, member_srl, applicant_name, result, score1, score1) value ('123', '2333', '4', 'adsf',
    '10', $args->score1)";
   $r = mysqli_query($connect, $q);
 
             // mysql_close($connect);
    
    */ 
  }

*update 함수

 

        function _updateApplicantExtraVars($comment_srl)
        {
			if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
            $vars = Context::getRequestVars();
			$args->comment_srl = $comment_srl;
			$args->applicant_name = strval($vars->applicant_name);
			$args->result = strval($vars->result);
			$args->score1 = strval($vars->score1);
			$args->score2 = strval($vars->score2);
			$args->score3 = strval($vars->score3);
			$args->score4 = strval($vars->score4);
			$args->score5 = strval($vars->score5);
			$args->score6 = strval($vars->score6);
			$args->score7 = strval($vars->score7);
			$args->mention1 = strval($vars->mention1);
			$args->mention2 = strval($vars->mention2);
			$args->mention3 = strval($vars->mention3);
			$args->mention4 = strval($vars->mention4);
			$args->mention5 = strval($vars->mention5);
			$args->mention6 = strval($vars->mention6);
			$args->mention7 = strval($vars->mention7);

            $judgeoutput = executeQuery('paper.updateJudgeOpinion', $args);

			return $judgeoutput;
        }
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
아로미로 XE admin페이지 고유 박스크기가 이상해져요 [2] file 2014.01.13 by 아로미로
溺內 lang을 스킨에서 재선언하는 방법...? [2] 2014.01.13 by 溺內
dja12123 회원 가입 약관 Err : '' template file does not exists. file  
건즈 1.5.3부터 업데이트 불가능 벌써 1년 --- 업데이트하고 싶습니다~~~ [1] file 2014.01.13 by 건즈
ForcePlane layout.html 파일을 변경해서 업로드 하였는데, 적용이 안됩니다 ㅠ [4] file 2014.01.13 by ForcePlane
라라라라데이 어제 질문 올렸었는데요. 업데이트 후 관리자 메뉴가 엉터리로 뜨는경우 [1] file 2014.01.13 by 멀티비타민
ToFinder 게시물 번호 가져오기. [10] 2014.01.13 by ToFinder
건즈 xe 1.5.4.4부턴 없나요? [2] 2014.01.13 by 건즈
잇힝~887 로그인이 풀리는문제 [2] 2014.01.13 by 마야^
Fidelity 과학생회 홈페이지 무차별 스팸 난립 [3] 2014.01.13 by 도라미
agoe45 스케치북5 1.6.3.6 사용자입니다. 댓글을 가장 최신순으로 보여주는 방법..좀 알려주세요 [7] 2014.01.13 by 멀티비타민
짝사랑 사이트 속도 관련.. [1] 2014.01.13 by Canto
맥문동 스케치북 모바일 스킨 닉네임을 누를때..... [6] file 2014.01.13 by 맥문동
nike077 제로보드 xe 회원가입 모듈에서 "메일링 가입" 을 "예" 로 설정하고 싶은데요 [4] 2014.01.13 by 페이먼트
나다미 링크 게시판 이용시 외부 계정 이미지 썸네일 출력하기  
Fidelity 특정 모듈마다 HTML 내용 다르게 하기. [1] 2014.01.13 by Fidelity
가난한법학도 다음 코드 중 무엇이 잘못된 걸까요? [1] 2014.01.13 by 가난한법학도
파워뭉치 도와주세요~~관리자 패스워드 해킹당한거 같아요.. [4] 2014.01.14 by 파워뭉치
이즈야 Context::loadFIle 질문 [3] file 2014.01.14 by Lansi
qorqor 닉네임이 안 보이게 하고 싶습니다. [1] 2014.01.14 by qorqor
구름나무바위 XE는 기본적으로 DOCTYPE - HTML, XHTML 중 어느것으로 작성 되어 있나요? [2] 2014.01.14 by 구름나무바위
shindn [긴급] 글, 댓글 작성시 "서버에 요청 중입니다. 잠시만 기다려 주세요" 무한 반복+작성 실패 [2] 2014.01.14 by shindn
구름나무바위 XE 콘텐츠 몰을 만들 수 있는 프로그램이나 모듈이 있나요? [4] 2014.01.14 by 푸시아
kongjeya 게시판 등록 버튼 누른후 알림 메세지..board.js 수정에관해..도와주세요~ [4] 2014.01.14 by kongjeya
화랑529 이 페이지는 어떻게 만들죠 ? [5] file 2014.01.14 by 담소
PodongS2 크롬에서는 정상이나 IE에서는 깨집니다..해결법 주세요. [3] file 2014.01.14 by 담소
내가마~ 로고경로를 바꾸고싶은데....위치를못찾겠네요 [5] 2014.01.14 by 담소
Mregg 멀쩡했는데 갑자기 익스플로워에서 테일블이 깨졌습니다. 도와주세요. [2] 2014.01.14 by 후끈한지니
몽실아빠 특정모듈에서 출력되지 않게 하고 싶습니다. [5] 2014.01.14 by BJ람보
오홀 코어를 업그레이드 했는데 홈페이지가 날라갔습니다. [10] 2014.01.14 by 야옹이님