$value ) { $requestStr.=$key . " : " . $value . "\n"; error_log ( $key . " : " . $value . "
\r\n" ); } error_log ( "End Printing Request Attributes" ); save_log($requestStr,'delete course','DELETE','delete_course.php'); // Check if subject_id is provided in the request if(!empty($_REQUEST['id'])){ // Construct the delete query $query = "DELETE FROM courses WHERE id = '".$_REQUEST['id']."'"; // Log the query for debugging error_log('course_delete: ' . $query); // Execute the query and handle errors if (!$result = @mysqli_query($conn, $query)) { // If query execution fails, log the error and return FAILURE response exit(mysqli_error($conn)); echo json_encode("FAILURE"); } else { // If query execution succeeds, return SUCCESS response echo json_encode("SUCCESS"); } } ?>