CI 묻고 답하기

제목 데이터베이스 2개 연동 할때요.
글쓴이 초보프로그래머 작성시각 2015/08/04 17:53:11
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 15437   RSS
레퍼런스에 있는것과 같이 database.php 에 똑같은걸로 하고 디폴트말고 test 로 했는데

디비에서 부를떄

$this->db->select();
$this->db->from('ㅁㄴㅇㄹ');
        
$notice_data = $this->db->get()->result();

db를 test로 해야하는건가요?

어떡해 사용법을 잘 모르겠네요 ㅠㅠ db['test']->select(); 이거인가요?
 다음글 이클립스 + CodeIgniter + FTP 사용 시 ... (4)
 이전글 include 질문드립니다. (2)

댓글

한대승(불의회상) / 2015/08/05 09:39:06 / 추천 0
아래 처럼 하시면 됩니다.
$testdb = $this->load->database('test');
$testdb->select();
$testdb->from();

$notice_data = $testdb->get()->result();
http://cikorea.net/user_guide_2.1.0/database/connecting.html