Not really... This is a one-to-many association... The ArticleCategory field 'name' is what i want to search for. I know I can do a one-to-many relationship... and then, I can grab all the fields and show only those that match the criteria... What I was wanting is for the sql server return me only the data I need...
-Sergio On Oct 22, 8:33 am, Charlie van de Kerkhof <[EMAIL PROTECTED]> wrote: > I assume that you also have a Category model? > Then setup the right associations in Article and Category and > ArticleCategory and use the $this->resursive = 1 var in Article or > Category to get the associations of that article or category > > - Charlie > > On Oct 22, 1:25 pm, LS <[EMAIL PROTECTED]> wrote: > > > Hello everyone! > > I promise I tried searching for this in this group and other sql- > > related groups... Maybe I just haven't searched for the right thing... > > Or even, maybe my head is not working properly... > > > Here's the thing: I have 2 tables. One with articles and one with > > categories... It goes like this (i used the model names): > > > Article (id, date, name, description) > > ArticleCategory (id, article_id, name) > > > ids are integer, date is datetime, names are varchar and description > > is text. > > > So, I have many articles with "n" categories each. And I want to grab > > all the articles that are from "Category One" _and_ "Category > > Three" (just an example, ofcourse). > > I just couldn't find a suitable query to retrieve that... I'm starting > > to wonder if it is even possible to do it using only one query... > > > Any help is appreciated... Thanks in advance! > > - Sergio --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
