Answer the question
In order to leave comments, you need to log in
Why doesn't GROUP_CONCAT work?
There is a query that selects books and authors for them. There are 3 tables: books, authors, authors_books
It is necessary that all authors associated with it be displayed next to the book.
$sql = "SELECT b.*,a.name,a.surname, GROUP_CONCAT(a.surname) as surname FROM books b"
. " INNER JOIN authors_books ab on b.id = ab.book_id"
. " LEFT JOIN authors a on ab.author_id = a.id";
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question