How To Select More Than One Column From Different Tables And Display It

I’m new to yii framework. I’m able to create models for all the tables of the database. Now, Im able to retrieve rows of only one table at a time. Currently, I’m working on 4 tables in the database namely test1,test2, test3, test4.

When I do localhost/yii/test/index.php?r=test1, I get to see the rows of table test1. Similarly, I can get the rows of the other tables.

Now, I have a requirement to display the table with columns of other tables.

The query is something like this - "Select a.name,b.name,c.name,d.name from test1 a,test2 b,test3 c,test4 d where a.id=b.id and c.id=d.id". How can I write this query by joining columns of different tables into single table. Please guide me for which files to be changed.

check

this link and read a bit more about yii you will be comfortable very soon :)