title: CodeIgniter , how to get single element instead of array of size 1?
body: <p>I'm new to CodeIgniter. I love it, it's great, but one issue cannot resolve for days.</p>
  
  <p>I'm trying to get a single row, by its id, like this :</p>
  
  <pre><code>$query = $this-&gt;db-&gt;get_where('content', ['id' =&gt; $id]);
  $the_content = $query-&gt;result_array();
  </code></pre>
  
  <p>However, it results in an array of size 1, like this:</p>
  
  <pre><code>$the_content = [ 0 =&gt; ['id' =&gt; 1, 'content'=&gt; 'abc']];
  </code></pre>
  
  <p>so I always have to convert it to its first element like this:</p>
  
  <pre><code>$the_content= $the_content[0];
  </code></pre>
  
  <p>But you can understand why I don't like this.</p>
  
  <p>I also tried <code>$query-&gt;result();</code> , still the same.</p>
  
  <p>I'm sure I'm missing a simple point here, but what?</p>
  
  <p>How do I get single element from ActiveRecord instead of array?</p>