Files
alphacar-dashboard/get_notifications.php

20 lines
535 B
PHP

<?php
require 'config.php';
require 'db.php';
$result = $dbhandle->query("
SELECT n.id, u.discord_name, n.message, n.type, n.created_at
FROM notifications n
JOIN users u ON n.user_id = u.id
WHERE n.is_read = 0
ORDER BY n.created_at DESC
");
while ($row = $result->fetch_assoc()) {
echo "<div class='notif'>";
echo "<b>".htmlspecialchars($row['discord_name'])."</b> ";
echo htmlspecialchars($row['message']);
echo " <small>(".htmlspecialchars($row['created_at']).")</small>";
echo "</div>";
}