mirror of
https://github.com/janunger/rheinwerk-video-training.git
synced 2026-02-05 22:55:14 +01:00
Kapitel 6 Lektion 7 gesplittet
This commit is contained in:
@@ -5,12 +5,8 @@ require __DIR__ . '/_application.php';
|
||||
$db = holeDatenbankverbindung();
|
||||
|
||||
if (count($_POST) > 0) {
|
||||
$insertStatement = $db->prepare("INSERT INTO lieder (cd_id, track, titel) VALUES (:cd_id, :track, :titel)");
|
||||
$insertStatement->execute([
|
||||
'cd_id' => $_GET['id'],
|
||||
'track' => $_POST['track'],
|
||||
'titel' => $_POST['titel']
|
||||
]);
|
||||
|
||||
// TODO: Lied in die Datenbank speichern
|
||||
|
||||
header('Location: cd.php?id=' . htmlspecialchars($_GET['id']));
|
||||
exit;
|
||||
@@ -29,7 +25,7 @@ $cdStatement = $db->prepare("
|
||||
$cdStatement->execute(['cd_id' => $_GET['id']]);
|
||||
$cd = $cdStatement->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$liederStatement = $db->prepare("SELECT * FROM lieder where cd_id = :cd_id ORDER BY track ASC");
|
||||
$liederStatement = $db->prepare("SELECT * FROM lieder where cd_id = :cd_id");
|
||||
$liederStatement->execute(['cd_id' => $_GET['id']]);
|
||||
$lieder = $liederStatement->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user