Undefined Offset error PHP
<p>Having an interesting problem with a piece of legacy web application I am working on, I keep getting the following error:
<code>Notice: Undefined offset:</code> 0,1,2,3, etc etc</p>

<p>I have a jQuery tablesorter that sorts the data based on user input. This error <em>only</em> occurs for results that are on page 2+.</p>

<p>So if I go to update the results on page 1, everything is fine, I do not get the above Offset Error. However,any page other than 2 throws me that above offset error.</p>

<p>The following is the php code that is generating the error:</p>

<pre><code>if(count($_POST)&gt;0) {
 if ($_POST['action'] == "update"){
  // find out how many records there are to update
  $size = count($_POST['review_id']);

  // start a loop in order to update each record
  $i = 0;
  while ($i &lt; $size) {
  // define each variable
  $approved = $_POST['approved'][$i];
  $banned = $_POST['banned'][$i];
  $review_id = $_POST['review_id'][$i];
  //var_dump($approved);
  //var_dump($banned);
  //var_dump($review_id);
  if (isset($_POST['delete'][$i])){
   $delete = 1;
  } else {
   $delete = 0; 
  }
</code></pre>

<p>The $approved, $banned and $review_id are the ones that cause the errors. The <code>var_dump</code> seems to output the string when the results are on page. however, on any pages greater than one all the <code>var_dump</code> outputs is NULL NULL NULL respectively. </p>

<p>I have checked with Firebug and all the select forms are named appropriately <code>&lt;select name="approved[4]" id="select2"&gt;</code> even the ones on page 2 <code>&lt;select name="approved[79]" id="select2"&gt;</code></p>

<p>Any help would be much appreciated. </p>

<p><strong>EDIT:</strong> If I change the amount of rows delivered to page one it works fine. By that I mean: If I let PHP display 50 rows on the first page as opposed to the 25 currently, it updates correctly. So any amount of results on page 1 updates fine, any results that may flow over to page 2 and beyond - <strong>do not!</strong>.</p>
