<?php
include '../db.php'; 

$data = json_decode(file_get_contents('php://input'), true);

if (isset($data['q_id']) && isset($data['q_remarks'])) {
    $q_id = mysqli_real_escape_string($con, $data['q_id']);
    $q_remarks = mysqli_real_escape_string($con, $data['q_remarks']);

    $update_query = "UPDATE query_table SET q_remarks = '$q_remarks' WHERE q_id = '$q_id'";
    if (mysqli_query($con, $update_query)) {
        echo "Remark updated successfully.";
    } else {
        echo "Failed to update remark: " . mysqli_error($con);
    }
} else {
    echo "Invalid input.";
}

mysqli_close($con);
?>