title: Codeigniter - Create two or more result objects from single query
body: <p>Please look at this code:</p>
  
  <pre><code>$query = $this-&gt;db-&gt;query("SELECT * FROM comments c LEFT JOIN users u ON u.user_id = c.user_id");
  foreach ($query-&gt;result('Comment') as $comment)
  {
  // $comment holds all data from both tables
  }
  </code></pre>
  
  <p>So, what I want is to have two objects <code>$comment</code> (only with columns from comments table as object properties) and <code>$user</code> for that comment. <strong>Is there any simple way to get that?</strong></p>
  
  <p>Please note that this is general question and I need all columns from both tables and sometimes columns in one table can have names as columns in other tables.</p>