Ok I got it working, but its outside of the array I want. Anyway to
get it in there?
[TeamsUser] => Array
(
[id] => 1
[team_id] => 1
[user_id] => 2
[role] => leader
[status] => approved
[joinDate] => 1231636154
)
[0] => Array
(
[totalMembers] => 6
)
Heres my query:
'fields' => array('TeamsUser.*', "(SELECT COUNT(id) FROM teams_users
AS TeamsUser WHERE TeamsUser.team_id = Team.id AND TeamsUser.status =
'approved') AS totalMembers")
I tried doing AS TeamsUser.totalMembers and it didnt work.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---