Why not return data from findAll

code:

	$criteria = new CDbCriteria;


	$criteria->select = 'cat_id,cat_name';


	$criteria->condition = 'parent_id=0';


	$criteria->order = 'cat_id ASC';


	$cates = Category::model()->findAll($criteria);

but return array(0){}

appreciate for your any answer.

What are you expecting to see?

empty array here. I want to return the array of categories with columns of cat_id and cat_name.

Are you sure you have categories with parent_id=0?

Thank for samdark’s help. I’ve had an answer to the question.

$criteria->condition = ‘parent_id=0’ is error.