CDbCriteria


(Rohit N Sarpotdar) #1

What is alias property used for?

while constructing a sql query, it by default uses t for main table. But I wanted to alias it.

But, $criteria->alias=‘user’;

won’t actually replace t in a query. Then how to use alias? and what is it for?

i’m using CActiveDataProvider to list down users. Does it affect anyway?

Regards.


(Waprave) #2

You may use it to alias related tables;


(Rohit N Sarpotdar) #3

Yes I know that, I read docs. But the problem is, the query built is not reflecting the alias. It still uses t which is default!