title: Codeigniter - how to get data from a model query into controller function
body: <p>I'm having trouble understanding how to get data (single row) from a model query into a controller function in codeigniter. I've searched the stack overflow posts, but no luck. I have a query in a model like this:</p>
  
  <pre><code>function login($email, $sha1Pass) {
      $loginArray = array('email' =&gt; $email, 'pw' =&gt; $sha1Pass);
      $this-&gt;db-&gt;select('lid, email, pw');
      $this-&gt;db-&gt;from('login');
      $this-&gt;db-&gt;where($loginArray);
      $query = $this-&gt;db-&gt;get();
      return $query-&gt;row();
  }
  </code></pre>
  
  <p>There will only be 1 returned row <code>[lid, email, pw]</code></p>
  
  <p>I then have a controller that calls this model query.</p>
  
  <pre><code>$report['row'] = $this-&gt;LoginCheck-&gt;login($email, $encp); 
  </code></pre>
  
  <p>What I need is 2 fields from the database from the row and assign them to a variable like this:</p>
  
  <pre><code>$lid = $report['lid'];
  $email = $report['email'];
  </code></pre>
  
  <p><code>lid</code> and <code>email</code> are the fields from the database.</p>