if i set the public function relations as below, am i also needed to set foreign key at User database?? or i just needed to
declare at public function relations() only??
class user extends CActiveRecord
public function relations()
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
'comp_id' => array(self::BELONGS_TO, 'company', 'company_id'),
'user_id' => array(self::HAS_ONE, 'company', 'user_id'),
You mean even without make relation in DB, i still can show 2 different table info in as long i declare public function relations()?? Currently i fail to set relation in DB, i using SQLyog-MySQL GUI to store the DB.