prepare("SELECT id, kontostand, darstellungsfarbe AS backgroundcolor, bezeichnung AS konto FROM konto WHERE id = :konto_id;"); $stmt->execute(['konto_id' => $konto_id]); $konto = $stmt->fetchAll(PDO::FETCH_ASSOC); // Da nur ein Konto abgefragt wird, sind diese Werte in allen Ergebnissen gleich $konto_bezeichnung = $konto[0]['konto']; $konto_kontostand = $konto[0]['kontostand']; $konto_backgroundColor = $konto[0]['backgroundcolor']; $stmt = $pdo->prepare("SELECT kb.id AS kontobewegung_id, kb.betrag, kb.beschreibung, kb.datum_ausgegeben, kb.datum_abgebucht, kb.kostenfix_id FROM kontobewegung kb LEFT OUTER JOIN kostenfix kf ON kf.id = kb.kostenfix_id WHERE kb.konto_id = :konto_id ORDER BY datum_ausgegeben DESC, kb.id DESC;"); $stmt->execute(['konto_id' => $konto_id]); $kontobewegung = $stmt->fetchAll(PDO::FETCH_ASSOC); ?>
| gebucht | ausgegeben | Beschreibung | Betrag |
|---|---|---|---|
| = empty($y['datum_abgebucht']) ? '' : htmlspecialchars($y['datum_abgebucht']) ?> | = htmlspecialchars($y['datum_ausgegeben']) ?> | = htmlspecialchars($y['beschreibung']) ?> | = number_format($y['betrag'], 2, ",", ".") ?> € |