Hi All,

I want to create a search model using CActiveRecord.

Can I use more then one tables for this?

Class Search extends CActiveRecord{

    function tableName(){

      return array('tbl1','bl2'); // is like this possible?



Is there any other method that can be used?

CActiveRecord represents a single tuple (row) in a table. I would personally create a class that better represents what you are trying to abstract. I’m not certain what that is but I think your trying to get a square peg in a round hole here.

it is called "Relational Active Record"


I think, what I should do is

As we are searching the database and we will include a set of tables that needs to be searched with selected values/columns, so

1 - Create Relations of the table with concerned tables

2 - Use Compare feature to get the list of items from each of the table

3 - Remove Duplicate Items

4 - Display them

Thanks for all.