title: how to return query result as one array in codeigniter
body: <p>i have table (tag)..
  i want to select all tags in this table and return it as single array where tag_id = index
  and tag_name = value
  like this array</p>
  
  <pre><code>array(
              3 =&gt; 'Hazel Grouse',
              4 =&gt; 'Common Quail',
              5 =&gt; 'Common Pheasant',
              6 =&gt; 'Northern Shoveler',
              7 =&gt; 'Greylag Goose',
              8 =&gt; 'Barnacle Goose',
              9 =&gt; 'Lesser Spotted Woodpecker',
              10 =&gt; 'Eurasian Pygmy-Owl',
              11 =&gt; 'Dunlin',
              13 =&gt; 'Black Scoter',
  )
  </code></pre>
  
  <p>tags return like this multi D array</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [tag_id] =&gt; 3
              [tag_name] =&gt; Hazel Grouse
          )
  
      [1] =&gt; Array
          (
              [tag_id] =&gt; 4
              [tag_name] =&gt; Common Quail
          )
  </code></pre>
  
  <p>this is query code </p>
  
  <pre><code> function get_alltags() {
          $this-&gt;db-&gt;select('tag_id');
          $this-&gt;db-&gt;select('tag_name');
          $result = $this-&gt;db-&gt;get('d_tag');
       return $result-&gt;result_array();
      }
      $alltags = $this-&gt;tag-&gt;get_alltags();
          echo "&lt;pre&gt;";
          print_r($alltags);
          echo "&lt;/pre&gt;";
          exit;
  </code></pre>