<?php
include "../connection/config.php";
extract($_REQUEST);

if(!isset($_REQUEST['pass'])){
  $check = query("select * from users where mobile='$mobile'");

  if(rows($check) > 0)
  {
     $data['success'] = "2";
         $data['msg'] = "Mobile number found";
  } else {
     $data['success'] = "0";
         $data['msg'] = "Mobile number not registered with us";
    
  }
  
} else {
  
  query("update users set password='$pass' where mobile='$mobile'");
     $data['success'] = "1";
         $data['msg'] = "Password updated successfully";
}

echo json_encode($data);