What are some best practices for marking a thread as "Resolved" in a PHP forum?

Issue: To mark a thread as "Resolved" in a PHP forum, it is important to update the thread status in the database and display a visual indicator to show that the thread has been resolved. PHP Code Snippet:

// Assuming $thread_id is the ID of the thread to be marked as resolved

// Update the thread status in the database
$query = "UPDATE threads SET status = 'Resolved' WHERE id = $thread_id";
$result = mysqli_query($connection, $query);

if ($result) {
    echo "Thread marked as Resolved";
} else {
    echo "Error marking thread as Resolved";
}