<?php

require_once 'config.php';
//$error=false;
$errors=array();

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
	
    $user_id = $_POST['user_id'];
    $passwd = $_POST['keypin'];
    // $passwd=  md5($passwd);
   
	//$query = "SELECT * FROM users WHERE insta_no='".$username."' AND pin='".$passwd."'  AND is_insta=1   AND status=1";
	$yes=mysqli_query($con,"UPDATE users SET pin='".$passwd."' WHERE insta_no=".$user_id);
	
    //$row = mysqli_query($con,$query);
     
    if ($yes) { 
		
		$errors['success']='Key pin updated successfully';
    } else {
        //$error=true;
		$errors['success']='Userid and pin are Wrong !!';
    }
	echo json_encode($errors);
  
}

?>