title: How to query a database from view - CodeIgniter
body: <p>I have query that runs in the controller:</p>
  
  <pre><code>$data['query'] = $this-&gt;Member-&gt;select_sql($id);    
  $this-&gt;load-&gt;view('myform');
  </code></pre>
  
  <p>and then outputs data in the view:</p>
  
  <pre><code>foreach ($query-&gt;result() as $row):
     echo $row-&gt;post_title;
     echo $row-&gt;post_user_id;
  endforeach;
  </code></pre>
  
  <p>So this outputs me a list of posts made by a user. Now I would like to run one more query that would for each post loop through my user table and output user information next to each post. (I dont want to select data from a view or joint those 2 tables at this time in MySQL)</p>
  
  <p>Any ideas? </p>