Hi i have the following associations:

var $hasAndBelongsToMany = array('Improvements');
var $hasAndBelongsToMany = array('Tags');

With a join table improvements_tags

I want to be able to count the number of time a tag has been used.
The following sql query works, but i'm not sure how to do this in
CakePHP?

SELECT tags.id, tags.title, COUNT(improvements_tags.tag_id) AS no_tags
FROM tags, improvements_tags WHERE tags.id = improvements_tags.tag_id
GROUP BY tags.id

I've tried to bindModel with a count in the find condition, but it
never seems to work.  Any help would be really appreciated.

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