title: codeigniter single result without foreach loop
body: <p>I am using codeigniter to get a single result from the db, like this:</p>
  
  <pre><code>$user = $this-&gt;db-&gt;query("SELECT * FROM users LIMIT 1");
  </code></pre>
  
  <p>I am then getting the returned object and looping trough it, this way:</p>
  
  <pre><code>foreach ($user-&gt;result() as $row) { ... }
  </code></pre>
  
  <p>As you can imagine, there is not point in using the loop, since there is only one result. Is there a way to get users parameters without looping? Something among this line:</p>
  
  <pre><code>echo $user['name'];
  </code></pre>
  
  <p>Thanks in advance.</p>