PHP
2
Вклад в тег
$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> ';
}