reportify_mncl/public/userarea/importify/delete_compound_synonym.php

18 lines
572 B
PHP

<?php
include('../include/headscript.php');
include("../class/company.php");
$conn = new mysqli($servername, $username, $password, $database);
if (isset($_POST['id'])) {
$id = $_POST['id'];
$stmt = $conn->prepare("DELETE FROM compundsvocabulary WHERE idcompoundsvocabulary = ?");
$stmt->bind_param('i', $id);
if ($stmt->execute()) {
echo json_encode(['success' => true]);
} else {
echo json_encode(['success' => false, 'error' => $stmt->error]);
}
} else {
echo json_encode(['success' => false, 'error' => 'Invalid input']);
}