In my app, Posts HABTM Tags.

I'm trying to find all Posts matching a specified Tag and order them
by Post.created DESC.

Here is my code:

$this->set('data', $this->Tag->find('all', array('conditions' =>
array('Tag.name' => $tag), 'order' => 'Post.created DESC')));

Which gives me the following error:

"SQL Error: 1054: Unknown column 'Post.created' in 'order clause'"



Is it possible to order the results in the Tags table by a field in
the associated Posts table? If not, is it possible to search the Posts
table, but narrow the results to a specific Tag?

Also, when running the find query normally (without the 'order'
condition), it doesn't find all the additional tags for the posts it
finds, just the tag I was searching by...even when setting $this->Tag-
>recursive = 2;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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