title: Codeigniter join 2 tables on a pivot table
body: <p>So I am trying to join Table A, and Table B by using a pivot Table C as the joining parameter. I am wondering how to do this in codeigniter. So for example</p>
  
  <p>Table A has 3 fields and an ID
  Table B has 3 different fields and an ID
  Table C has 1 ID from Table A and 1 ID from Table B joining them.</p>
  
  <p>Now normally a join in codeigniter would be </p>
  
  <pre><code>$this-&gt;db-&gt;select('*');
  $this-&gt;db-&gt;from('tableA');
  $this-&gt;db-&gt;join('tableB', 'tableB.ID = tableA.tableBID');
  </code></pre>
  
  <p>This works, when Table B and Table A have a common ID to join, but when the only way to get to Table B is through Table C I do not know how to do it from CI. Any ideas? </p>