Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function ChangePassword($username, $password, $new_password) {
- $canUserLogin = $this->isLoginExist($username, $password);
- if($canUserLogin){
- $query = "UPDATE users SET password = $new_password WHERE username = $username";
- $inserted = mysqli_query($this->db->getDb(), $query);
- if($inserted == 1){
- $json['success'] = 1;
- }else{
- $json['success'] = 0;
- }
- mysqli_close($this->db->getDb());
- }else{
- $json['success'] = 2;
- }
- return $json;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement