Hi there,
I’m trying to return a model to a view but I want to record sorted by a column name that is not id.
So instead of $model=Property::model()->findByPk($id);
I want to find by ‘columnName’.
Is this possible?
Thanks in advance.
Hi there,
I’m trying to return a model to a view but I want to record sorted by a column name that is not id.
So instead of $model=Property::model()->findByPk($id);
I want to find by ‘columnName’.
Is this possible?
Thanks in advance.
Hi
There are many ways to do that depending of what exactly you want to do
One of them:
Property::model()->findByAttributes(array('column_name'=>$your_value));