title: Return a single value from CI model method
body: <p>I've got a method that's meant to return a single value. Because <code>-&gt;result()</code> returns an array I'm using the following to return the single value I'd like to get:</p>
  
  <pre><code>return array_pop($this-&gt;db-&gt;query($SQL)-&gt;result())-&gt;event_name;
  </code></pre>
  
  <p>while it works perfectly fine, I'm wondering if there's something built into CI that maybe I've missed in the documentation. I also use this same trick to return a single record:</p>
  
  <pre><code>return array_pop($this-&gt;db-&gt;query($SQL)-&gt;result());
  </code></pre>
  
  <p>Is there a better way to do this?</p>