Define Fields On Findall

Hello friends.

I would like defining what fields are show in my find, for example in my table I have this fields:

name,email,password,date.

When I execute in my controller for exemplo:

$data = MyModel::model()->findAll();

print_r($data);

I have this result:

Array ( [name] => xxx [email] => yy [password] => zz [date] => zz )

But I Would like to choose the fields:

Array ( [name] => xxx [email] => yy [date] => zz )

How can I do this?




$myModel= MyModel::model()->findAll(array('select'=>'zzz,xx'));

Thank you

Like queries, reports, and correspondence templates, defined fields must be placed into the design.Weu can query on number fields to find all items with numbers within a rangeā€¦