<?php

require_once('db.php');
// Create connection 
//$conn = new mysqli($servername, $username, $password, $dbname);
   $userPhone= trim($_POST["phone"]);

   // check phone number
   $sql = "select * from user where  email = '$userPhone'";
   $countUser = mysqli_query($conn, $sql);
   if(mysqli_num_rows($countUser) > 0) {
        $res->success = 'matching';
        echo json_encode($res);
   } else {
        $res->success = 'Phone Number not matching';
	    echo json_encode($res);
    //   echo 'not matching';
       
   }

// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
// echo "Connected successfully";