Can you help me how to change the password in MVC PHP : this is my MODEL:

    public function editNewPassword($data){
		// $user_name = $data['user_name'];
		$user_id = $data['id'];
		$user_oldpass = $data['password'];
		$user_newpass = $data['newpass'];


		$sql = "UPDATE user SET password = '".md5($user_newpass)."' WHERE password = 'md5($user_oldpass)' ";
			$query = $this->db->prepare($sql);
			$query->execute();
	}

	
	public function getUser(){
		return $this->db->select("SELECT * FROM 'users'");
	}
    

This is my CONTROLLER:

    function changePassword(){
			if(isset ($_POST['edit_password'])){
				$user_oldpass = ($_POST['user_oldpass']);
				$user_id = ($_POST['user_id']);
				$user_name = ($_POST['user_name']);
				$user_newpass = ($_POST['user_newpass']);
				
				$this->model->editNewPassword($data);
		}		
	}
	

this is for my VIEW code:

    <form role="form">
	<!-- <input typ	e="text" name="username" id="username" placeholder="Enter Your Username"><br> -->
	<input type="text" name="old_password" id="old_password" placeholder="Enter Your Old Password"><br>
	<input type="text" name="new_password" id="new_password" placeholder="Enter Your New Password"><br>
	<input type="text" name="con_newpassword" id="con_newmpassword" placeholder="Enter Confirm Password"><br>
	<span id='message'></span>
	<input type="hidden" id="edit_password_id">
	<button id="edit_password" style="background-color:#008000">Submit</button>
</form>
    

This is my javascript code:

    $('#edit_password').on('click', function(){
	// alert('Password changed successfully!')
	var 
	user_id = $('#edit_password_id').val();
	user_name = $('#username').val();
	user_oldpass = $('#oldpassword').val();
	user_newpass = $('#newpassword').val();
	

    $.ajax({
	url: URL+'changepassword/changePassword',
	type: "post",
	data: {
		id : id,
		name : name,
		password : password, 
		newpass : newpass
	},
	success: function(response){
		$('#edit_password_id').modal('toggle');
		location.reload();
	},
	error: function(jqXHR, textStatus, errorThrown) {
		console.log(textStatus, errorThrown);
	}
    });
    });

My problem is my password won't change even no error and I don't know where is the error to my code. if anyone know to solve this please help me
PS: I am new to this ;-)