getMessage(); die(); } $query = 'SELECT "Notes".title, "Notes"."updatedAt", "Notes"."shortid", "Users".profile FROM "Notes" JOIN "Users" ON "Notes"."ownerId" = "Users".id WHERE permission = \'freely\' OR permission = \'editable\' OR permission = \'limited\' ORDER BY "Notes"."updatedAt" DESC'; try { $stmt = $dbh->query($query); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); } catch (PDOException $e) { echo "Error: " . $e->getMessage(); die(); } function formatDateString($stringDate) { $datetime = DateTime::createFromFormat('Y-m-d H:i:s.uP', $stringDate); $formattedDate = $datetime->format('d.m.Y H:i'); return $formattedDate; } ?>
Titel | Owner | Last edit |
---|---|---|
= $row['title'] ?> | = json_decode($row['profile'])->username ?> | = formatDateString($row['updatedAt']) ?> |