CActive Record Issue

I am still facing problem with CActiveRecord.

I building relations of two elements of a table, is it required that both of the elements are primary keys of the tables?

If it is not necessary, then How to make a relation?

Second Problem that I am currently facing is that

After getting the data from the SQL, How we can display it using Widget i.e. CListView etc


How can both be primary key? The first table has a field (foreign key) that holds a value from the field of the other table… in the other table the referenced field it’s good if it is the primary key… but it does not have to be…

use ‘on’ when declaring the relation

If you haven’t done yet… read first the Definitive guide to Yii and the Yii blog tutorial… and do not just read… do the examples… .create the default application…