CI 묻고 답하기

제목 DB 쿼리 프로파일링 문의
글쓴이 Suworld 작성시각 2010/04/26 10:43:43
댓글 : 7 추천 : 0 스크랩 : 0 조회수 : 25134   RSS

안녕하세요

DB쿼리문을 볼려고 하는데요 쿼리문이 나오지 않아서 그러는데요

어떻게 해야지만 쿼리를 볼 수 있을 지 궁금해서 이렇게

글을 남깁니다.

알려주시면 감사하겠습니다. ^^

class Notice extends Controller{ 
  protected $SET_MENU_DATA = array();
  protected $SET_DATA = array();
  protected $seg_exp = array();
  
  function __construct(){
   
   parent::Controller();
   
   $this->output->enable_profiler(TRUE);
   

   }
}

--> 설정 후 결과

 다음글 checkbox 값 처리에 대한 문의 (4)
 이전글 위젯 질문드립니다. (1)

댓글

변종원(웅파) / 2010/04/26 11:39:14 / 추천 0
__construct 하부에 메소드가 있는지요? 쿼리를 날리는...

Suworld / 2010/04/26 13:53:30 / 추천 0

<?
 class Notice extends Controller{ 
  protected $SET_MENU_DATA = array();
  protected $SET_DATA = array();
  protected $seg_exp = array();
  
  function __construct(){
   parent::Controller();
   
   //웹페이지 분석 시 사용
   $this->output->enable_profiler(TRUE);
   
   /* include common file */
   if(file_exists(OP7_COMMON_FILE)){
    include OP7_COMMON_FILE;
   }

   /* include common menu file */
   if(file_exists(OP7_COMMON_MENU_FILE)){
    include OP7_COMMON_MENU_FILE;
   }
  }
  
  function index(){
  
   switch($this->uri->segment(2)){
    //기본:전체
    case 'all':
     $this->notice('all');
    break;
    
    //공지사항
    case 'notice':
     $this->notice('notice');
    break;
    
    //이벤트
    case 'event':
     $this->notice('event');
    break;
    
    //기본:전체
    default:
     $this->notice('all');
    break;
   }
    
  }

  //공지사항 구분(리스트/내용)
  function notice($type){
   
   /* common bbs */
 
   $this->load->library('netgame_bbs');

   $this->SET_DATA['mode'] = $this->netgame_bbs->mode ? $this->netgame_bbs->mode : 'list';
   //세그먼트 2번째 걸로 모드 결정
   //예) http://citestOP7.netgame.com/notice/all
   //세드먼트 2번째인 all이 mode
 
   if($this->SET_DATA['mode'] == 'list'){
 
    $this->SET_DATA['pageSize'] = 12;
    $this->SET_DATA['pageBlock'] = 10;
    
    //netgame_bbs->noticeList 경로 --> C:\mgame_project\eclipse_workspace\us_ci_project\Codeigniter\system\libraries\Netgame_bbs.php
    //noticeList(게임명,카테고리,페이지,보이기구분,메인구분,맨위에 나타내기구분)
    $this->netgame_bbs->noticeList(GAME_NAME, $this->SET_DATA['cate'], $this->SET_DATA['pageSize'],"'Y','M','T'"); 
    
    $this->SET_DATA['cate'] = $type;
    $this->SET_DATA['page'] = $this->netgame_bbs->page;
    $this->SET_DATA['searchName'] = $this->netgame_bbs->searchName;
    $this->SET_DATA['searchWord'] = $this->netgame_bbs->searchWord;
    $this->SET_DATA['sort'] = $this->netgame_bbs->sort;

    $this->SET_DATA['result'] = $this->netgame_bbs->result;
    $this->SET_DATA['totalCount'] = $this->netgame_bbs->totalCount;
    $this->SET_DATA['totalPage'] = $this->netgame_bbs->totalPage;
    $this->SET_DATA['Numbering'] = $this->netgame_bbs->Numbering;
    
    /*************************** Paging S *************************************/
    $this->SET_DATA['pagination_links'] = $this->netgame_lib->pagination($this->seg_exp, paging($this->SET_DATA['page'], $this->SET_DATA['pageSize'], $this->SET_DATA['totalCount'], $this->SET_DATA['pageBlock']));
    /*************************** Paging E *************************************/    
   
   }else if($this->SET_DATA['mode'] == 'view'){
        
    $this->netgame_bbs->noticeView(GAME_NAME, $type, $this->SET_DATA['pageSize'],"'Y','M','T'", false);

    $this->SET_DATA['cate'] = $type;
    $this->SET_DATA['listNo'] = $this->netgame_bbs->listNo;
    $this->SET_DATA['page'] = $this->netgame_bbs->page;
    $this->SET_DATA['searchName'] = $this->netgame_bbs->searchName;
    $this->SET_DATA['searchWord'] = $this->netgame_bbs->searchWord;
    $this->SET_DATA['resultView'] = $this->netgame_bbs->result_view;
    $this->SET_DATA['idx'] = $this->netgame_bbs->idx;
   }
   
   //데이터 넘길 경우 $this->SET_DATA 같이 설정 해야 함
   //$this->SET_MENU_DATA가 있는 장소
   //C:\mgame_project\eclipse_workspace\us_ci_project\framework\US\testop7.netgame.com\application\config\constants.php
   
   //TOP
   $this->load->view('include/sub_top',$this->SET_DATA);
   
   //로그인 - 공용
   $this->load->view('include/login', $this->SET_DATA);
   
   //공지사항 - left 메뉴
   $this->load->view('notice/left_menu');
   
   //퀵메뉴 - 공용
   $this->load->view('include/quick_menu');
   
   //공지사항  - 내용
   $this->load->view('notice/notice_'.$this->SET_DATA['mode'], $this->SET_DATA);
   
   //BOTTOM - 공용
   $this->load->view('include/bottom');
 
  }
 }
?>

이게 전체 소스 인데요 PHP 5버전이어서 그런 현상이 생기는 건지 모르겠네요~

변종원(웅파) / 2010/04/26 14:05:27 / 추천 0
 프로파일러 맨 밑 라인에 답이 나와있네요. db 드라이버가 로드되지 않았다는...
Suworld / 2010/04/26 14:17:12 / 추천 0
정상적으로 게시판글이 나오는데요 로드가 왜 안됬다고 나오는지 궁금해서요

로드가 안됬다면 게시판 글이 나오지 않아야 하는데

어떻게 된건지 모르겠어요~
변종원(웅파) / 2010/04/26 14:36:08 / 추천 0
 혹시 config/database.php에 설정된 기본db설정을 사용하기는게 아니라
사용자 셋을 선언해서 사용하시는거 같네요.
그럴 경우 프로파일러가 작동하지 않습니다.
Suworld / 2010/04/26 17:16:14 / 추천 0

아 그런 경우도 있군요~
제가 한것은 /Codeigniter/system/libraries/에서 게시판을 가지고 오고요

여기 DB  정보는
/framework/US/testop7.netgame.com/application/config/database.php
에서 가지고 오게 하였습니다.

실제 URL상 연결 되어 있는 부분은 testop7.netgame.com 이후 부터 입니다.

/Codeigniter/system/libraries/에 만든 이유는 다른 사이트랑 공용으로 쓰기 위해서

만들었습니다.

이럴경우에도 나오지 않을까 궁굼하네요

그리고 도움 말씀 주셔서 정말 감사합니다^^

 

변종원(웅파) / 2010/04/26 20:55:57 / 추천 0
library라 그럴겁니다.

프로파일러 파일을 보니 쿼리내용을 $this->CI 에서 가져옵니다. library에서 db연결하기 위해 생성한 인스턴스가 아닌 ci 자체의 객체에서 가져오다보니 그렇네요.