<?php

include('db-connect.php');



if (isset($_POST['certificationtype']) && isset($_POST['idtrf'])) {

    $certificationtype = $_POST['certificationtype'];

    $idtrf = $_POST['idtrf'];



    // Correggi l'errore sintattico includendo i backtick intorno al nome della tabella

    $query = "UPDATE `trf-details` SET `certificationtyped` = ? WHERE `idtrfdetails` = ?";

    $stmt = $con->prepare($query);

    $stmt->bind_param('ii', $certificationtype, $idtrf);



    if ($stmt->execute()) {

        echo "success"; // Risposta al client

    } else {

        echo "error"; // In caso di errore

    }

}

