Find data from database using findByPk() method in yiiframework
Example:
$var = Model name::model()->findByPk(2);
echo $var->name;
?>
Here “2″ is a PK and “Model Name” is a name of model.
when “echo $->any_variable->name” is executed then display name base of pk.
Findall Example
SomeActiveRecord::Model()->findAll(“”);