CDbCriteria join problem with users table


i have a problem with CDBCriteria, it seems it can’t get users table and name column.

The code:

In view:


Any ideas?

Do you have name property in your xxx model?

yes i have a same error.

Steps to add fields in the serch should have the following

  1. public variable

  2. add the field name in rules method in safe array

  3. write you condition for fetch the result

Example :

$public $var;

public function rules()


array(‘var’, ‘safe’, ‘on’=>‘search’)


if 1, 2 are fail this error will be raised.

"variable var not defined".