Add option to make comments invisible (not having to delete them). This is for moderation purposes. #3

Merged
masiv merged 1 commits from development into main 2026-02-12 20:08:59 -03:00
2 changed files with 2 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
declare(strict_types=1);
function retrieve_chat_history(object $pdo){
$query = "SELECT username, content, date_sent FROM comments;";
$query = "SELECT username, content, date_sent FROM comments WHERE visible=true;";
$stmt = $pdo->prepare($query);
$stmt->execute();

View File

@@ -2,6 +2,7 @@ CREATE TABLE comments (
id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(255) NOT NULL,
content TEXT NOT NULL,
visible BOOLEAN DEFAULT 1,
date_sent DATETIME DEFAULT CURRENT_TIME,
users_id INT(11) NOT NULL,
PRIMARY KEY (id),