title: CakePHP UpdateAll Only Updating Last Entered Data
body: <p>I have built an invoice system in my new CakePHP site and I am currently trying to build a function that will let me save the re-edited information back into the same records.</p>
  
  <p>Below is the section of code I am working on, </p>
  
  <pre><code>    $InvoiceDataVar = $this-&gt;data['Invoicedata'];
  
      foreach ($InvoiceDataVar as $DataKey =&gt; $DataValue) {
  
          $UpdateWork = $InvoiceDataVar[$DataKey]['workdes'];
          debug($UpdateWork);
          $this-&gt;Invoicedata-&gt;updateAll(
                                        array('Invoicedata.workdes' =&gt; "'$UpdateWork'"),
                                        array('Invoicedata.invoicejoblists_id' =&gt; $InvoiceID)
                                        );
      }
  </code></pre>
  
  <p>This is work $this->data holds,</p>
  
  <pre><code>  'Invoicedata' =&gt; array(
      (int) 0 =&gt; array(
          'workdes' =&gt; 'test new update 1',
          'price' =&gt; '500.00'
      ),
      (int) 1 =&gt; array(
          'workdes' =&gt; 'test new update 2',
          'price' =&gt; '501.00'
      ),
      (int) 2 =&gt; array(
          'workdes' =&gt; 'test new update 3',
          'price' =&gt; '503.00'
      ),
      (int) 3 =&gt; array(
          'workdes' =&gt; 'test new update 4',
          'price' =&gt; '504.00'
      ),
      (int) 4 =&gt; array(
          'workdes' =&gt; 'test new update 5',
          'price' =&gt; '505.00'
      ),
      (int) 5 =&gt; array(
          'workdes' =&gt; 'test new update 6',
          'price' =&gt; '999.99'
      )
  )
  </code></pre>
  
  <p>These are of course just test data, but unless I am not understanding the UpdateAll function documentation which I have gone over many times, all this will do is update all the six fields with the last test input. Right now all the fields for the workdes contain, 'test new update 6'.</p>
  
  <p>I should also say that there might not be all ways be six fields, there will always be at lest one, with a max (at this time) of 6 inputs to update.</p>
  
  <p>I was thinking about loading the 'ID of the invoicedata table, which is an auto count number, where as the joblist_id is the same id in all the the fields being updated? This is my current line of thinking....</p>
  
  <p>Any Help is most welcome.</p>
  
  <p>Glenn.</p>