
<?php 
error_reporting(0);

include('db_connect.php');
$response = array(); 
if(isset($_POST['user_id'])) {
	
	$sender_id = $_POST['user_id'];
	$receiver_id = $_POST['receiver_id'];
	
  $query="DELETE FROM `friend_req` WHERE `sender_id`='$sender_id' AND `receiver_id`='$receiver_id'";
  if(mysqli_query($conn,$query)){
			$response['error'] = false;
			$response['message'] = "Request Cancelled!";
  } else {
		  $response['error'] = true; 
		  $response['message'] = "Some error occurred please try again!";
  }
} else {
	echo "error";
}
	echo json_encode($response);
mysqli_close($conn);
?>