<?php 
include 'conn.php';
$data = [];
$userID = $_POST['user'];
$password = $_POST['password'];
 
$password = hash('sha512', $password);
$desc = "Select * FROM users where userID ='$userID' AND password = '$password' AND status ='1'";
$descRes = $mysqli->query($desc);
while($rowDesc = mysqli_fetch_array($descRes)){

 $data[] =  $rowDesc;

}
 if(count($data)>0){
    $response['status'] = true;
    $response['response'] = "User Exist";  
    $response['data'] = $data;  
    die(json_encode($response));
 }else{
    $response['status'] = false;
    $response['response'] = "Invalid Username or Password";  
    die(json_encode($response));    
 }

 


?>