title: CakePHP update field value based on other value in same row?
body: <p>I have been trying to figure out how to do this and it seems that its not something that many people are trying to do in cakephp or I am just completely misunderstanding the documentation.. I am using the following query below to get a field value so I get a value where the "findbycreated" is 0... this part works fine</p>
  
  <pre><code>$unregisteredemail = $this-&gt;Testmodel-&gt;findBycreated('0');
  $emailaddress = $unregisteredemail['Testmodel']['emailaddress'] ;
  $emailpassword = $unregisteredemail['Testmodel']['password'] ;
  </code></pre>
  
  <p>But now, after I do some things with this data that I retrieved, I want to mark a field, in the same row, in the same model / table as a value of '1' to indicate that an action has taken place (email address has been successfully created, for example)... I just can't figure out how to do this in cakephp despite my efforts of going through the documentation and searching, this should be rather simple, I am tempted, at this point, to just use a regular mysql query as its a simple query.. basically the query is (please excuse my syntax as I haven't used direct mysql queries in a while) "update (database / table) set 'created'='1' where 'emailaddress'=$emailaddress"</p>
  
  <p>Or I could use the row ID, if needed, as cakephp seems to prefer this, but still can't get how to do this.. this is my attempt below that is not working:</p>
  
  <pre><code>// update database to show that email address has been created
  $this-&gt;Testmodel-&gt;read('emailaddress', $this-&gt;Testmodel-&gt;findBycreated('0'))
  $this-&gt;Testmodel-&gt;id = 1;
  $this-&gt;Testmodel-&gt;set(array(
              'created' =&gt; '1'
              ));
  
   $this-&gt;Testmodel-&gt;save();
  </code></pre>