
<?php 
error_reporting(0);

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