질문
Q #10292
DB join 해서 불러오려고 합니다.
지존보
2013-01-25 19:49:24
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(); 했는데 되지가 않습니다.
어떻게 해야 하는지 알려주세요. 위에 쿼리문으로 돌렸을 때에는 이상이 없습니다.
페이지 하단에 나온 쿼리를 비교해보세요.