title: CodeIgniter - Get next record from an array
body: <p>I get all data from a table to a array :</p>
  
  <pre><code>$records = $this-&gt;Misc-&gt;getAll('table');
  </code></pre>
  
  <p>Next I made a loop</p>
  
  <pre><code>foreach ($records as $key =&gt; $record) {     
      // here i want to update a column in the fist
      // row with a value from the second row
      $this-&gt;Misc-&gt;update($record-&gt;id; $value_of_a_column_from_the_next_row);
  }
  </code></pre>
  
  <p>How can I do this?
  Thanks</p>