Hi guys,
I am having some problems in writing a query for search.My case is as
given below
I have two tables books(having attributes like titles,subtitles etc)
and authors(having attributes first name and last name).They have a
many to many relationship between them and related by books_authors
table.
Now I want to write a search such that any query string that matches
the author fname,lname or books title subtitle then it must show the
result.

Now my problem is if I use joins that is books INNER JOIN
books_authors ON books.id = books_authors.book_id INNER JOIN authors
ON authors.id = books_authors.author_id WHERE conditions then it would
return multiple records for the same book for different author names
of the same book.This won't work.

Now if I use two queries one with $this->Book->findall('condition's)
and $this->Book->Author->findall('conditions')  then I have two
resultsets.I don't want this either.

So is there any alternative way for this that is the result in only
one query which does check for book attributes and book attributes?
Seeking for help


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

Reply via email to