title: Association in cakephp multiple databases Cakephp 2
body: <p>How to get data form multiple databases.</p>
  
  <p>Example- </p>
  
  <pre><code>two database -&gt; db_1 and db_2.
  two tables -&gt; users in db_1 database and countries in db_2   
      users table -&gt; id , username, country_id, status
      countries table -&gt; id, name, status
  </code></pre>
  
  <p>and Association is -</p>
  
  <pre><code>App::uses('AppModel', 'Model');
  
  class User extends AppModel 
  {
  var $name = 'User';
  var $useDbConfig = 'bd_1';
  var $belongsTo = array('Country'=&gt;array('className'=&gt;'Country'), );
  }
  </code></pre>
  
  <h2>And in Controller when I use this Query then get a error</h2>
  
  <pre><code>    $data = $this-&gt;User-&gt;find('all', array('conditions' =&gt; array('Country.status' =&gt; 1)));
  
      $this-&gt;set('data', $data);
  </code></pre>
  
  <blockquote>
    <p>Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column
    'Country.status' in 'where clause</p>
  </blockquote>