
<?php

require ('../credentials.php');
$con=mysqli_connect(HOST, USERNAME, PASSWORD, DBNAME)or die("cannot connect"); 

// array for JSON response

   
if(isset($_REQUEST['user_id']) && isset($_REQUEST['student_id']) )
{
    $user_id=$_POST['user_id'];
	 $student_id=$_POST['student_id'];
	 
	  
	  $sql="DELETE FROM parent_children WHERE parent_id='$user_id' AND student_id='$student_id'";
	$result = mysqli_query($con, $sql) or die("Error in Selecting " . mysqli_error($con));

		if(!$result){
		// failed to delete
            $response["error"] = TRUE;
            $response["error_msg"] = "Error occured !";
            echo json_encode($response);
		  }else{
			//Ward successfully removed  
			$response["error"] = FALSE;
            $response["success_msg"] = "Ward successfully removed.!";
            echo json_encode($response);
		    }
		  
		  }
	
	  
	

   

mysqli_close($con);


?>
