I have these tree tables in the database:
books
book_id book_title
1 PHP
2 Lincoln
books_authors
book_id author_id
1 1
1 3
2 1
2 2
authors
author_id author_name
1 Dan Brown
2 Ernest Hemingway
3 William Shakspare
I want to visualice the Book Name and the authors , and I do it with two join statements.
My question is how to visualice the table in a PHP page like that:
http://postimg.org/image/69kjbhjmd/
I mean if the books are the same to visualice their authors on the same line.
Try this, do some googling before posting question here. There are so many simple join available to learn
SELECT B.book_title,C.author_name
FROM books_authors A
JOIN books B ON A.book_id = B.book_id
JOIN authors C ON A.author_id = C.author_id