Thank you. Could you suggest me some book/link to learn this?
EDIT
Using another code, suggested by someone of you in another thread (no more visible ), I managed to get this new code, working as expected:
require "$root/PDO_connect.php";
$sql = $pdo->query("
SELECT a.autore, a.autore_nome, b.autore, b.autore_nome, b.titolo, b.edizione, b.luogo, b.data
FROM bibliografie__autori a
INNER JOIN bibliografie b
WHERE a.autore = b.autore
ORDER BY a.autore
");
$autori = $sql->fetchAll(PDO::FETCH_GROUP);
$posts = array();
foreach($autori as $autore => $books) {
echo "
<div class='left'>
<h2>" . $books[0]['autore'] . " </h2>\n
";
foreach($books as $book) {
printf("<p>[$book[data]] <i>$book[titolo]</i>, $book[edizione], $book[luogo]</p>");
}
echo "
</div>\n";
}
I have to do some improvements, but it works.