0) { // TODO: Lied in die Datenbank speichern header('Location: cd.php?id=' . htmlspecialchars($_GET['id'])); exit; } $cdStatement = $db->prepare(" SELECT cds.id, cds.name AS cdname, cds.erscheinungsjahr, kuenstler.name AS kuenstlername FROM cds LEFT JOIN kuenstler ON cds.kuenstler_id = kuenstler.id WHERE cds.id = :cd_id "); $cdStatement->execute(['cd_id' => $_GET['id']]); $cd = $cdStatement->fetch(PDO::FETCH_ASSOC); $liederStatement = $db->prepare("SELECT * FROM lieder where cd_id = :cd_id"); $liederStatement->execute(['cd_id' => $_GET['id']]); $lieder = $liederStatement->fetchAll(PDO::FETCH_ASSOC); ?>