<?php

include('db-connect.php'); // Connessione al database



if (isset($_POST['idcontacts'])) {

    $idcontacts = $_POST['idcontacts'];



    // Esegui la query per eliminare il contatto

    $deleteQuery = $cmctrfdb->prepare("DELETE FROM contacts WHERE idcontacts = ?");

    $deleteQuery->bind_param("i", $idcontacts);



    if ($deleteQuery->execute()) {

        echo 'success';

    } else {

        echo 'error';

    }



    $deleteQuery->close();

}

