Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.1 kB
13
Indexable
Never
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['delete_id'])) {
        $deleteId = $_POST['delete_id'];
        $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>';
        }
    }