<?php

	 include 'config.inc.php';
	 
	 // Check whether username or password is set from android	
     if(isset($_POST['username']) && isset($_POST['password']))
     {
		  // Innitialize Variable
		  $result='';
	   	  $username = $_POST['username'];
          $password = $_POST['password'];
		  
	   	  //$username = "a";
          //$password = "a";		  
		  
		  
		  // Query database for row exist or not
          $sql = "SELECT * FROM users WHERE  email = '$username' AND password = '$password'";
          $stmt = $conn->query($sql);	
		  
		  $row_cnt = $stmt->num_rows;
		  //echo $row_cnt;
		  
		 //if (row_cnt($result)==0) { PERFORM ACTION }	  
		  if ($row_cnt == 0) 
          {
			 $result="false";	
          }  
          else
          {
			  	$result="true";
          }
		  
		  // send result back to android
   		  echo $result;	
  	}
	

	
//echo "true";
	
	
	
	
	
	
	
?>