<item>
<value1='c4ca4238a0b923820dcc509a6f75849b'/>
<value2='c81e728d9d4c2f636f067f89cc14862c'/>
<value3='eccbc87e4b5ce2fe28308fd9f2a7baf3'/>
<value4='a87ff679a2f3e71d9181a67b7542122c'/>
<value5='e4da3b7fbbce2345d7772b0674a318d5'/>
<value6='1679091c5a880faf6fb5e6087eb1b2dc'/>
</item>
$g=$mysqli->query("SELECT authors.f_name, authors.s_name,books.b_name FROM authors
JOIN author_books ON authors.id=author_books.author_id JOIN
books ON books.id=author_books.book_id WHERE authors.f_name='Дмитрий' OR authors.s_name LIKE 'А%' GROUP BY authors.f_name,authors.s_name");
$g=$mysqli->query("SELECT CONCAT(authors.f_name,' ',authors.s_name) as name, books.b_name FROM authors
JOIN author_books ON authors.id=author_books.author_id JOIN
books ON books.id=author_books.book_id WHERE authors.f_name='Дмитрий' OR authors.s_name LIKE 'А%' GROUP BY name");
foreach($result as $v){
echo '<tr>
<td>'.$v['b_name'].'</td>
<td>'.$v["name"].'</td>
</tr> ';
}
SELECT a.*, b.count_book
FROM authors a,
(SELECT author_id, COUNT(book_id) as count_book
FROM author_books GROUP BY author_id
HAVING COUNT(book_id) > 1) b
WHERE a.id = b.author_id
$sql = "SELECT a.*, b.count_book FROM authors a, (SELECT author_id, COUNT(book_id) as count_book FROM author_books GROUP BY author_id HAVING COUNT(book_id) > 1) b WHERE a.id = b.author_id";
$results = $mysqli->query($sql);
foreach($results as $result) {
echo $result['f_name'] . " " . $result['s_name'] . " - " . $result['count_book'] . " книг";
}