PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am running a query that references three tables in a MySQL database, and it almost works fine. The output is a list of books from a specific category and some of their attributes. The problem is some books have more than one author, and when this is the case I get more than one result for a particular title. I am wondering if anyone sees a way to loop through authors where there are more than one, each title displayed only once. This may be a job for the MySQL board... Thanks for looking.
$query = "SELECT books.*, author.author FROM books, author, category WHERE books.isbn = category.isbn AND books.isbn = author.isbn AND category.category = '$category' ORDER BY author.author";
Thanks for the help. I am not sure if I follow the logic though. When I implement the code it seems to jostle authors around, but does not associate more than one author with a book when appropriate. So I get the same number of results, but not necessarily the right author associated with a book.