diff --git a/data.php b/data.php new file mode 100644 index 0000000..c57f757 --- /dev/null +++ b/data.php @@ -0,0 +1,15 @@ +query("SELECT kk.id, + vorderseite, + rueckseite, + farbe, + name + FROM karteikarte kk + JOIN kategorie k ON k.id = kk.kategorie_id;"); + $karteikarten = $stmt->fetchAll(PDO::FETCH_ASSOC); + + echo json_encode($karteikarten); \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..d19311a Binary files /dev/null and b/favicon.ico differ diff --git a/index.php b/index.php index 2d8acbe..5700a7f 100644 --- a/index.php +++ b/index.php @@ -2,9 +2,11 @@ require_once __DIR__ . '/includes/db_connect.php'; $system = getenv('POSTGRES_SYSTEM') ?? 'test'; - $stmt = $pdo->query("SELECT vorderseite + $stmt = $pdo -> query("SELECT COUNT(*) AS gesamtanzahl FROM karteikarte;"); - $karteikarten = $stmt->fetchAll(PDO::FETCH_ASSOC); + $row = $stmt->fetch(PDO::FETCH_ASSOC); + + $gesamtanzahl = $row ? $row['gesamtanzahl'] : 0; ?> @@ -13,8 +15,78 @@
- -Vorderseite: = $y['vorderseite'] ?>
- +