Proper sorting

This commit is contained in:
Lncvrt committed 2025-03-12 20:32:03 -07:00
1 parent b5360ef5ca
commit 4d56dcf360
1 file changed
+1 -5
+1 -5
View File
@@ -9,14 +9,10 @@ $censor = new CensorWords();
$conn = connectToDatabase(); $conn = connectToDatabase();
$stmt = $conn->prepare("SELECT * FROM colors"); $stmt = $conn->prepare("SELECT * FROM colors ORDER BY timestamp DESC");
$stmt->execute(); $stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC); $result = $stmt->fetchAll(PDO::FETCH_ASSOC);
usort($result, function($a, $b) {
return strcmp($b['timestamp'], $a['timestamp']);
});
$lastInsertId = $_GET['highlight'] ?? null; $lastInsertId = $_GET['highlight'] ?? null;
?> ?>
<!DOCTYPE html> <!DOCTYPE html>