title: cakephp compare password for webservice
body: <p>I'm new to cakephp, I'm implementing a web service for update password where user will provide oldpassword, newpassword, username parametrs, I have to check in db if that username has the old password, then update db with newpassword.</p>
  
  <p>what I have done so far is, I got the parametrs, I can fetch the data with username like this</p>
  
  <pre><code> $username = $this-&gt;request-&gt;query['username'];
   $oldpassword = $this-&gt;request-&gt;query['oldpassword'];
   $dataexist = $this-&gt;User-&gt;find('first', array('fields' =&gt; array('User.id','User.username','User.password'), 'conditions' =&gt; array('User.username' =&gt; $username)));
  </code></pre>
  
  <p>Now its returning data, but if I use password field like this</p>
  
  <pre><code>$dataexist = $this-&gt;User-&gt;find('first', array('fields' =&gt; array('User.id','User.username','User.password'), 'conditions' =&gt; array('User.username' =&gt; $username,'User.password' =&gt; $oldpassword)));
  </code></pre>
  
  <p>Its returning empty result, even I pass correct old password..!
  where I'm doing mistake, any help is much appreciated...</p>