title: codeigniter active record join 2 databases
body: <p>Can I use a <code>$this-&gt;db-&gt;join('database.table')</code> without inserting the second parameter of this function? I need to connect 2 databases, but they dont have nothing that binds them. I know that it works with SQL because I have tried it, however I want to change the model using active record, because I find it more flexible etc.. but I dont know how to insert <strong>the join</strong></p>
  
  <pre><code>$this-&gt;db-&gt;select('users.user_id');
  $this-&gt;db-&gt;distinct();
  $this-&gt;db-&gt;from('users');
  $this-&gt;db-&gt;join('user_detail', 'users.user_id = user_detail.id', 'left');
  </code></pre>
  
  <p>and now something like:</p>
  
  <pre><code>$this-&gt;db-&gt;join('cities.city');
  </code></pre>
  
  <p>So the SQL should be like:</p>
  
  <pre><code>SELECT DISTINCT users.user_id FROM users LEFT JOIN .... JOIN cities.city
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>SELECT DISTINCT users.user_id FROM users LEFT JOIN .... JOIN cities.city ON
  </code></pre>
  
  <p>What I actually have.</p>
  
  <p>Please help. Thank you.</p>