SHARE
TWEET

Untitled

a guest Dec 13th, 2016 204 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function getUserDetailsWithPassword($username, $password)
  2.     {
  3.     $returnValue = array();
  4.     $sql = "select userUsername,userPassword from userInfo where userUsername='" .$username . "' and userPassword='" .$password . "'";
  5.  
  6.     $result = $this->conn->query($sql);
  7.     if ($result != null && (mysqli_num_rows($result) >= 1)) {
  8.     $row = $result->fetch_array(MYSQLI_ASSOC);
  9.     if (!empty($row)) {
  10.     $returnValue = $row;
  11.     }
  12.     }
  13.     return $returnValue;
  14.     }
  15.    
  16. $dao = new MySQLDao();
  17. $dao->openConnection();
  18. $userDetails = $dao->getUserDetailsWithPassword($username, $secure_password);
  19.  
  20. if(!empty($userDetails))
  21. {
  22. $returnValue["status"] = "Success";
  23. $returnValue["message"] = "User is registered";
  24. echo json_encode($returnValue);
  25. } else {
  26.  
  27. $returnValue["status"] = "error";
  28. $returnValue["message"] = "User is not found";
  29. echo json_encode($returnValue);
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top