Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
979 B
2
Indexable
Never
<?php
  

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['deleteid'])) {
    $deleteId = $_POST['deleteid'];
    $deleteSql = "DELETE FROM Tbl_Customer WHERE AcctID = ?";
    $deleteParams = array($deleteId);
    $deleteQuery = sqlsrv_query($conn, $deleteSql, $deleteParams);

    if ($deleteQuery) {
        echo '<script>
                Swal.fire({
                    title: "Success!",
                    text: "Data deleted successfully.",
                    icon: "success",
                    showConfirmButton: false,
                    timer: 1500
                }).then(() => {

                });
              </script>';
    } else {
        echo '<script>
                Swal.fire({
                    title: "Error!",
                    text: "Error deleting data.",
                    icon: "error",
                    showConfirmButton: true,
                });
              </script>';
    }
}




?>
Leave a Comment