mcki0127
(Steve)
July 24, 2017, 12:58am
1
I have the following query:
$memberArray = Profile::find()
->joinWith('user', true, 'RIGHT JOIN')
->select('
user.screen_name,
profile.*')
->(all);
The syntax table.column in the select statement is not working properly. The above code returns user.* or NULL depending on what I select for profile and regardless of what I choose for user. It works as expected in mySQL.
jkofsky
(Jkofsky)
July 24, 2017, 2:32am
2
I have the following query:
$memberArray = Profile::find()
->joinWith('user', true, 'RIGHT JOIN')
->select('
user.screen_name,
profile.*')
->(all);
The syntax table.column in the select statement is not working properly. The above code returns user.* or NULL depending on what I select for profile and regardless of what I choose for user. It works as expected in mySQL.
This may not help but, shouldn’t the end of that statement be ->all() or was that a typo?
I haven’t tried the joinWith(), select() stuff much so can’t help much otherwise.
mcki0127
(Steve)
July 24, 2017, 10:41am
3
jkofsky:
This may not help but, shouldn’t the end of that statement be ->all() or was that a typo?
I haven’t tried the joinWith(), select() stuff much so can’t help much otherwise.
Yes, that’s a typo. I have it as
->all();
mcki0127
(Steve)
July 24, 2017, 12:36pm
4
I’ve switched to the query builder and it’s working fine. For whatever reason, the Active Record doesn’t seem to be working as advertised.