<?php
require_once('db.php');
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
mysqli_set_charset($conn,'utf8');

   $email= $_POST["phone"];
   $password= $_POST["password"];

$sql = "SELECT * FROM `user`  WHERE email='$email' AND password='$password'";
    $run = mysqli_query($conn,$sql);
		if($run->num_rows > 0){
			//echo "Login Successful" ;
          	    $row = mysqli_fetch_assoc($run);
	    $res->user = $row;
	   // $res->id=$row['id'];
	    $res->success = 'Login Success';
	    echo json_encode($res);
		}else{
          $res->success = 'user not found';
  		  echo json_encode($res);
}

?>