<?php
    
require_once '../DB/db_credentials.php';
    require_once 
'../DB/db_connection.php';
    
// global $dbc; // needs to be set globally so $dbc is accessible in this file too
    
header('Content-Type: application/json');

    if (
$_SERVER["REQUEST_METHOD"] === "POST") {
        
$scheduleID $_POST["scheduleID"];

        
$query "DELETE FROM citeLeParis_schedule WHERE pk_scheduleID = ?";
        
$stmt mysqli_prepare($dbc$query);
        
mysqli_stmt_bind_param($stmt"i"$scheduleID);
        
mysqli_stmt_execute($stmt);
        
mysqli_stmt_close($stmt);

        echo 
json_encode(["status" => "success"]);
    }
?>