<?php

require_once '../auth/auth.php';
include '../models/db_connection.php';

if (isset($_GET['id'])) {
    $sql = mysqli_query($conn,"UPDATE messages SET read_status = '1' WHERE id = '$_GET[id]'");

    if ($sql) {
        echo "<script>
        alert('Message marked as read');
        window.location.href = 'index.php';
    </script>";
    }
}
