active record

Hi all

I think I have a problem

when I run a query with active record

var_dump the result is the attached file

but I just want:




array(9) {

    ["CODAREA"]=>

    string(1) "0"

    ["HOSPITAL"]=>

    string(16) "TOTAL PROVINCIAL"

    ["MES01"]=>

    string(6) "104453"

    ["MES02"]=>

    string(5) "99101"

    ["MES03"]=>

    string(6) "116640"

    ["MES04"]=>

    string(5) "65446"

    ["MES05"]=>

    string(5) "61006"

    ["MES06"]=>

    string(5) "64595"

    ["TOTAL"]=>

    string(6) "511241"

  }



This brings me memory problems when the query returns a lot of data

the code




   $table=CActiveRecord::model($modelClass)->find($criteria);


   echo '<pre>';

   var_dump($table);

   echo '<pre>';



try this:




function __debug ($data, $text='') {

	if (is_array($data) && count ($data) > 0 && ($data[0] instanceof CActiveRecord)) {

	  foreach ($data as $d) {

	    $tmp[] = $d->attributes;

	  }

	  $data = $tmp;

	}

	elseif ($data instanceof CActiveRecord) {

		$data = $data->attributes;

	}

  echo '<pre>';

   var_dump($data);

   echo '<pre>';

}