<?php
require_once('../../'.$_REQUEST['tenant'].'/config.php');

$messageId = $_POST['id'];
$sql = "UPDATE messages SET is_read = 1 WHERE id = ?";
$stmt = $con->prepare($sql);
$stmt->bind_param('i', $messageId);
if ($stmt->execute()) {
    echo 'success';
} else {
    echo 'error';
}
$stmt->close();
$con->close();
?>