Tickets erweitert

This commit is contained in:
2025-06-23 11:11:18 +02:00
parent 1964cadd8c
commit 66ff531ba4
2 changed files with 26 additions and 4 deletions

View File

@@ -28,4 +28,24 @@ class TicketModel extends Database {
return true;
}
public function hasTicket($userId, $eventId) {
$sql = "SELECT * FROM ticket WHERE userId = :userId AND eventId = :eventId";
$pdo = $this->linkDB();
$params = array(
":userId" => $userId,
":eventId" => $eventId,
);
try {
$sth = $pdo->prepare($sql);
$sth->execute($params);
return $sth->fetchAll(\PDO::FETCH_ASSOC);
} catch (PDOException $e) {
new \Blog\Library\ErrorMsg("Fehler beim Lesen der Daten.", $e);
die;
}
}
}