Hi all,

I am trying to perform:

$order = 'COUNT('Votes.vote_up');
$albums = $this->Album->findAll(null, null, $order);

Where `Album` hasMay `Vote`, and `Vote` belongsto `Album`.

When I run the above code, I get the following SQL error:

--
Query: SELECT `Album`.`id`, `Album`.`user_id`, `Album`.`title`,
`Album`.`description`, `Album`.`youtube_url`, `Album`.`deleted`,
`Album`.`created`, `Album`.`modified`, `User`.`id`, `User`.`username`,
`User`.`password`, `User`.`email`, `User`.`realname`,
`User`.`age_range_id`, `User`.`mobile`, `User`.`mlist_warchild`,
`User`.`mlist_amnesty`, `User`.`active`, `User`.`is_admin`,
`User`.`last_login`, `User`.`created`, `User`.`modified` FROM `albums`
AS `Album` LEFT JOIN `users` AS `User` ON (`Album`.`user_id` =
`User`.`id`) WHERE 1 = 1 ORDER BY `Votes`.`vote_up` DESC

Warning (512): SQL Error: 1054: Unknown column 'Votes.vote_up' in
'order clause' [CORE\cake\libs\model\datasources\dbo_source.php, line
440]
--

So it would appear that CakePHP 1.2.0.6311 is not adding Votes to the
SQL Query - what am I doing wrong?

Thanks
jonny.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to