csrtechnew.ohctech.in/delete_roles.php
2025-04-14 13:28:09 +05:30

23 lines
708 B
PHP

<?php
include('includes/config/config.php');
// Check if subject_id is provided in the request
if(!empty($_REQUEST['role_id'])){
// Construct the delete query
$query = "DELETE FROM Roles_Code WHERE role_id = '".$_REQUEST['role_id']."'";
// Log the query for debugging
error_log('role_code_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");
}
}
?>