title: How to join 3 tables using codeigniter without any null values in table?
body: <p><strong>My Query is</strong></p>
  
  <pre><code>$this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;from('private_messages');         
      $this-&gt;db-&gt;join('admin', 'admin.admin_id = private_messages.from_id', 'left');                
      $this-&gt;db-&gt;join('user', 'user.user_id = private_messages.from_id', 'left');
      $this-&gt;db-&gt;where('private_messages.hash_id',$id);
      $this-&gt;db-&gt;order_by('private_messages.time_sent','asc');
      $query=$this-&gt;db-&gt;get();        
      return $query-&gt;result_array();
  </code></pre>
  
  <p><strong>Output was:</strong></p>
  
  <pre><code>form_id | Username | Username
  21      |Praveen   |NULL
  21      |Praveen   |NULL
  3       |NULL      |admin
  3       |NULL      |admin
  </code></pre>
  
  <p>So please help remove all null and put username in single column.</p>