title: converting array to stdClass in CodeIgniter
body: <p>I am returning data from two tables in CodeIgniter with the function below</p>
  
  <pre><code>public function test()
  {
      $this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;from('WHOUSE1.DLY_BWR_DLY_PERFORMANCE');
      $this-&gt;db-&gt;join('WHOUSE1.DATE_DIM', 'WHOUSE1.DATE_DIM.DATE_KEY = WHOUSE1.DLY_BWR_DLY_PERFORMANCE.BDP_DATE');
      $query = $this-&gt;db-&gt;get();
      return $query-&gt;result_array();
  }
  </code></pre>
  
  <p><strong>Using var_dump I am getting the result below</strong> </p>
  
  <pre><code>array (size=3226)
  0 =&gt; 
  array (size=121)
    'BDP_ID' =&gt; string '945149' (length=6)
    'BDP_COST_CENTRE_NUMBER' =&gt; string '1376' (length=4)
    'BDP_DATE' =&gt; string '20040807' (length=8)
    'BDP_DAY_CODE' =&gt; string '6' (length=1)
    'BDP_TAKE' =&gt; string '4923.78' (length=7)
    'BDP_PAYOUT' =&gt; string '3779.22' (length=7)
    'BDP_ACTUAL_SLIPPAGE' =&gt; string '636' (length=3)
  
  1 =&gt; 
  array (size=121)
    'BDP_ID' =&gt; string '945150' (length=6)
    'BDP_COST_CENTRE_NUMBER' =&gt; string '1376' (length=4)
    'BDP_DATE' =&gt; string '20040809' (length=8)
    'BDP_DAY_CODE' =&gt; string '1' (length=1)
    'BDP_TAKE' =&gt; string '2848.3' (length=6)
    'BDP_PAYOUT' =&gt; string '4190.34' (length=7)
    'BDP_ACTUAL_SLIPPAGE' =&gt; string '280' (length=3)
  </code></pre>
  
  <p><strong>But what I will like to get is this</strong></p>
  
  <pre><code>  array (size=3226)
    0 =&gt; 
    object(stdClass)[27]
    'BDP_ID' =&gt; string '945149' (length=6)
    'BDP_COST_CENTRE_NUMBER' =&gt; string '1376' (length=4)
    'BDP_DATE' =&gt; string '20040807' (length=8)
    'BDP_DAY_CODE' =&gt; string '6' (length=1)
    'BDP_TAKE' =&gt; string '4923.78' (length=7)
    'BDP_PAYOUT' =&gt; string '3779.22' (length=7)
    'BDP_ACTUAL_SLIPPAGE' =&gt; string '636' (length=3)
  
    1 =&gt; 
    object(stdClass)[29]
    'BDP_ID' =&gt; string '945150' (length=6)
    'BDP_COST_CENTRE_NUMBER' =&gt; string '1376' (length=4)
    'BDP_DATE' =&gt; string '20040809' (length=8)
    'BDP_DAY_CODE' =&gt; string '1' (length=1)
    'BDP_TAKE' =&gt; string '2848.3' (length=6)
    'BDP_PAYOUT' =&gt; string '4190.34' (length=7)
    'BDP_ACTUAL_SLIPPAGE' =&gt; string '280' (length=3)
  </code></pre>
  
  <p>I can't seem to get a way of converting the array into object(stdClass) Any help will be appreciated as am new to CodeIgniter.</p>