<?php
	session_start();
	include"../../connect/db.php"; 
 ?>  
<?php
	if( isset($_POST['email']) ){


		$title = mysqli_real_escape_string($con,$_POST['title']);
		$f_name = mysqli_real_escape_string($con,$_POST['f_name']);
		$m_name = mysqli_real_escape_string($con,$_POST['m_name']);
		$l_name = mysqli_real_escape_string($con,$_POST['l_name']);
		$relationship = mysqli_real_escape_string($con,$_POST['relationship']);
		$email = mysqli_real_escape_string($con,$_POST['email']);
		$emails = mysqli_real_escape_string($con,$_POST['emails']);
		$phone = mysqli_real_escape_string($con,$_POST['phone']);
		$acc_num = mysqli_real_escape_string($con,$_POST['acc_num']);
		$d_o_b = mysqli_real_escape_string($con,$_POST['d_o_b']);
		$gender = mysqli_real_escape_string($con,$_POST['gender']);
		$address = mysqli_real_escape_string($con,$_POST['address']);
		$city = mysqli_real_escape_string($con,$_POST['city']);
		$state = mysqli_real_escape_string($con,$_POST['state']);
		$zip_code = mysqli_real_escape_string($con,$_POST['zip_code']);

			$sql = mysqli_query($con,"UPDATE beneficiary SET acc_num = '$acc_num',title = '$title',email = '$emails',  f_name = '$f_name', m_name ='$m_name', l_name = '$l_name',relationship = '$relationship' ,phone = '$phone',d_o_b = '$d_o_b' ,gender = '$gender',address = '$address',city = '$city',state = '$state',zip_code = '$zip_code' WHERE id = '$email' ");

			if( $sql ){
				echo "success";
			}
			else{
				echo mysqli_error($con) ;
			}

	}
	
?>