Re: I'm not sure how to write this query...

2008-12-27 Thread Kyle Decot
Tags are in their own table. They are associated to the blog model via a HABTM relationship. On Dec 27, 2:41 am, gearvOsh mileswjohn...@gmail.com wrote: How is your database setup? Are tags a column in the blog table or is it its own table? --~--~-~--~~~---~--~~

Re: I'm not sure how to write this query...

2008-12-27 Thread Andrew McCafferty
Hi Kyle, Here's a function you could try in your Post model - http://bin.cakephp.org/view/607120740 I've given it a default of 5 tags if called with no params. Obviously you can change this to suit or override it when you call it from your controller. e.g. $this-Post-postCountByTagCount(2)

Re: I'm not sure how to write this query...

2008-12-27 Thread Webweave
I would do something like (note that you'll need to modify to fit your data model and field names): $posts_w_tags = $this-Post-Tag-find('all', array( 'conditions' = array(

I'm not sure how to write this query...

2008-12-26 Thread Kyle Decot
I'm trying to write a query that finds how many blog posts have more then x number of tags. Could anyone provide me with an example of how to do this? I would be most grateful. Thank you as always. --~--~-~--~~~---~--~~ You received this message because you are

Re: I'm not sure how to write this query...

2008-12-26 Thread gearvOsh
How is your database setup? Are tags a column in the blog table or is it its own table? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To