CI 묻고 답하기

제목 DB join 해서 불러오려고 합니다.
글쓴이 지존보 작성시각 2013/01/25 19:49:24
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 13755   RSS

DB 쿼리 문입니다.
SELECT * FROM `TB_write` left outer join `TB_board_file` on TB_write.bo_table = TB_board_file.bo_table and TB_write.wr_id = TB_board_file.wr_id where TB_write.bo_table='".$bo_table."' and (TB_board_file.bf_no is null or TB_board_file.bf_no='0')

$bo_table 값은 special_issue 입니다.

아래의 쿼리를 불러오고 싶어서

$this->db->select('*');
  $this->db->from('TB_write');
  $this->db->join('TB_board_file','TB_write.bo_table = TB_board_file.bo_table and TB_write.wr_id = TB_board_file.wr_id','left outer');
  $this->db->where('TB_write.bo_table', $bo_table);
  $array = array('TB_board_file.bf_no'=>null,'TB_board_file.bf_no'=>'0');
  
  $this->db->or_where($array);
  

해서 $query = $this->db->get(); 했는데 되지가 않습니다.

어떻게 해야 하는지 알려주세요. 위에 쿼리문으로 돌렸을 때에는 이상이 없습니다.
 다음글 게시판 제작하다가 막혀서 문의 드립니다. (4)
 이전글 CI db 에러 처리 질문입니다. (3)

댓글

변종원(웅파) / 2013/01/28 23:23:25 / 추천 0
$this->output->enable_profiler(true); 컨트롤러 생성자에 넣어서 
페이지 하단에 나온 쿼리를 비교해보세요.