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'] . " книг";
}