34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include ('includes/functions.php');
|
|
include ('log_entry.php');
|
|
error_log ( "Start Printing Request Attributes" );
|
|
$requestStr="";
|
|
foreach ( $_REQUEST as $key => $value ) {
|
|
$requestStr.=$key . " : " . $value . "\n";
|
|
error_log ( $key . " : " . $value . "<br />\r\n" );
|
|
}
|
|
error_log ( "End Printing Request Attributes" );
|
|
save_log($requestStr,'delete tahsil','DELETE','delete_tehsil.php');
|
|
|
|
|
|
// Check if subject_id is provided in the request
|
|
if(!empty($_REQUEST['id'])){
|
|
// Construct the delete query
|
|
$query = "DELETE FROM tehsils WHERE id = '".$_REQUEST['id']."'";
|
|
|
|
// Log the query for debugging
|
|
error_log('tehsil_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");
|
|
}
|
|
}
|
|
?>
|