I am using Yii CActiveRecord A ->with('B')->findAll() method where one of hte column is common with A and B and this column is also a part of the condition.
Now the problem is that while executing it, I get the SQL error because mySQL does not know if i want to refer to A.column or B.column. I viewed the executed query and it seems yii names table as 't' while executing the query, so i appended the 't'.columnname in the condition and everything worked fine.
My question is if this kind of code is appropriate where i am using the condition as
'CURDATE( ) <= date AND t.removed = :removed AND ispublic = 1 AND isopen = 1'
while i do not refer what 't' is in the query. Yii renames the table on its own. Please let me know if this seems to be a fine coding practice or if there is a better way to do it.
thanks.