title: CodeIgniter - Pass database array from model to controller and then view
body: <p>This is probably really simple, but I just started using Code Igniter. </p>
  
  <p>I have the following code in a model and want to get the database query array to pass to the controller and then pass it to a page view. </p>
  
  <pre><code>public function view_user($id){
          $this-&gt;db-&gt;where('userid', $id);
          $query = $this-&gt;db-&gt;get('users');
          return $query-&gt;result_array();
  }
  </code></pre>
  
  <p>What is the code necessary to get the returned array in the controller?</p>
  
  <p>Thanks in advance for your help!</p>