I have these three tables
ad
user
zip_code
ad has many user
user has one zip_code
I am trying to access a zip_code column with this Active Record query:
$criteria->join = 'inner join user on user.id = ad.user_id inner join zip_code on zip_code.zip_code = user.zip_code ';
$results = ad::model()->with( ‘user’)->findAll($criteria);
when I call:
$results->zip_code->state
I don’t get an error, I get nothing, blank.
So, is it possible to access a column in zip_code from ad?
Thanks!