title: Retrieve data from two Databases on single controller in codeigniter
body: <p>i want to retrieve data from two different databases tables such as job database and classified database in that two databases i have job_history table and ad_mobile_phones table now i want to retrieve the data from these two tables on single controller
  please suggest me 
  thanks in advance</p>
  
  <pre><code>$active_group = 'default';
  $active_record = TRUE;
  
  
  
  //for job portal
  $db['default']['hostname'] = 'TZ07';
  $db['default']['username'] = 'root';
  $db['default']['password'] = 'TZ';
  $db['default']['database'] = 'doolaly_jobz';
  
  $db['default']['dbdriver'] = 'mysql';
  $db['default']['dbprefix'] = '';
  $db['default']['pconnect'] = TRUE;
  $db['default']['db_debug'] = TRUE;
  $db['default']['cache_on'] = FALSE;
  $db['default']['cachedir'] = '';
  $db['default']['char_set'] = 'utf8';
  $db['default']['dbcollat'] = 'utf8_general_ci';
  $db['default']['swap_pre'] = '';
  $db['default']['autoinit'] = TRUE;
  $db['default']['stricton'] = FALSE;
  
  
  //for classified portal
  $db['classified_db']['hostname'] = 'TZ07';
  $db['classified_db']['username'] = 'root';
  $db['classified_db']['password'] = 'TZ';
  $db['classified_db']['database'] = 'doolaly';
  
  
  
  $db['classified_db']['dbdriver'] = 'mysql';
  $db['classified_db']['dbprefix'] = '';
  $db['classified_db']['pconnect'] = TRUE;
  $db['classified_db']['db_debug'] = TRUE;
  $db['classified_db']['cache_on'] = FALSE;
  $db['classified_db']['cachedir'] = '';
  $db['classified_db']['char_set'] = 'utf8';
  $db['classified_db']['dbcollat'] = 'utf8_general_ci';
  $db['classified_db']['swap_pre'] = '';
  $db['classified_db']['autoinit'] = TRUE;
  $db['classified_db']['stricton'] = FALSE;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>class Account_detail extends CI_Controller 
  {
      public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;model('Jobseekermodel','',TRUE);
          $CI =   &amp;get_instance();
          $this-&gt;db = $CI-&gt;load-&gt;database('classified_db', TRUE);
          //$secound_db= $this-&gt;load-&gt;database('classified_db',TRUE);
          $this-&gt;load-&gt;model('Emailmodel','',TRUE);
          $this-&gt;load-&gt;model('Bookmodel','',TRUE);
          $this-&gt;load-&gt;model('Consultantmodel','',TRUE);
          $this-&gt;load-&gt;model('Openingmodel','',TRUE);
          $this-&gt;load-&gt;model('Commfuncmodel','',TRUE);
          $this-&gt;lang-&gt;load('message', 'english');
          $this-&gt;lang-&gt;load('mail', 'english');
          $this-&gt;load-&gt;library('form_validation');
          if (session_id() == "") session_start();
      }
  }
  </code></pre>