title: codeigniter join 2 table data
body: <p>hi everyone i am new to codeigniter and currently working on a small project in the project i am trying to join two tables and display there data in single table. i looked at the user guide that codeigniter has an i am not sure how this work</p>
  
  <p><code>$this-&gt;db-&gt;join();</code></p>
  
  <p>what table should be first and what id key should be firs. Can someone explain me more in detail about this please use examples if u can. I am trying to join credential table and tblanswers. Tnx for answering.</p>
  
  <p>i have tried to code a function using this example:</p>
  
  <pre><code>$this-&gt;db-&gt;select('*');
  $this-&gt;db-&gt;from('blogs');
  $this-&gt;db-&gt;join('comments', 'comments.id = blogs.id');
  
  $query = $this-&gt;db-&gt;get();
  </code></pre>
  
  <p><strong>EDIT:</strong>
  instead of using join method in codeigniter is it possible to use a simple function to retrieve the two table data separately? all i want is to echo the data from database table on to a html table in my website page to be displayed is it possible to write two get functions to retrieve two tables separately ?</p>