Server : Apache System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64 User : nobody ( 99) PHP Version : 8.1.23 Disable Function : NONE Directory : /home/dnlcambodia/www/dnl_dashboard/Service/ |
<?php // Step 1: Receive the request if(isset($_POST['id'])){ $projectId = $_POST['id']; // Step 3: Connect to the database include '../PHP/config/db_conn.php'; // Step 4: Prepare and execute the delete query $stmt = $conn->prepare("DELETE FROM service WHERE id = ?"); $stmt->bind_param("i", $projectId); if ($stmt->execute() === TRUE) { // Step 5: Handle success echo "Service deleted successfully"; } else { // Step 5: Handle failure echo "Error deleting Service: " . $conn->error; } $stmt->close(); $conn->close(); } else { echo "No service ID provided"; } ?>