<?php

require_once 'config.php';
$error=false;
$errors=array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    
	
	$id=$_POST['user_id'];
	$pin=$_POST['pin'];
	
	
	
	
	
		$createCustomer=mysqli_query($con,"UPDATE users  SET pin = '".$pin."' WHERE id= ".$id);
		
		if($createCustomer){
			$errors['success']='Pin updated Successfully ';
			$errors['status']='true';
			
		}else{
			$error=true;
			$errors['success']='Something went wrong!!!, Please try again.';
			$errors['status']='false';
		}
	
	echo json_encode($errors);
	
}
?>