PHP mysql_fetch_array is not returning all rows - one row is always ignored
<p>I am running a fairly straight forward mysql request and returning the results to a table.  There were three record in the db, and the query is pulling from two tables.  As a result, I am getting a count of three records (echoing mysql_num_rows), but only two show in the table.  Using a print_r command on the array result shows only one particular record - the other records do show in the print-r..  I added another record to the db, and now three records show - and the same record as before does not show and is the only record in the print_r command. 
Here's the relevant code:</p>

<pre><code>&lt;td id="page1"&gt; 
  &lt;?php             
    $limit  = 15;             // Set limit to show for pagination
    $page   = $_GET['page'];  // get page number from submit

    if($page) 
      $start = ($page - 1) * $limit; // first item to display on this page
    else
      $start = 0; // if no page var is given, set start to 0

    $query  = "SELECT PartyMstr.PartyMstrID, UserName, FirstName, LastName, XrefPartyRoleID
                FROM PartyMstrRole, PartyMstr
                WHERE PartyMstr.PartyMstrID = PartyMstrRole.PartyMstrID &amp;&amp;
                      PartyMstrRole.XrefPartyRoleID = 1 
                ORDER BY LastName, FirstName ASC
                LIMIT $start, $limit
              ";

    $result = mysql_query($query, $connection);

    $row = mysql_fetch_array($result) or die(mysql_error());
    $totalitems1 =  mysql_num_rows($result);
  ?&gt;
  &lt;center&gt;&lt;h3&gt; Admin User List &lt;/h3&gt;&lt;/center&gt;
  &lt;?php
    echo "&lt;table border=\"1\" align=\"center\"&gt;";
    echo "&lt;tr&gt;&lt;th&gt;PartyMaster ID&lt;/th&gt;";
    echo "&lt;th&gt;UserName&lt;/th&gt;";
    echo "&lt;th&gt;Last, First&lt;/th&gt;";
    echo "&lt;th&gt;Link&lt;/th&gt;&lt;/tr&gt;";

    while($row = mysql_fetch_array($result)) {
      echo "&lt;tr&gt;&lt;td&gt;";
      echo $row['PartyMstrID'];
      echo "&lt;td&gt;";
      echo $row['UserName'];
      echo "&lt;td&gt;";
      echo " " . $row['LastName'] . ", " . $row['FirstName'] . " ";
      echo "&lt;td&gt;";
      echo "&lt;a href = \"http://www.505575.com/editUser.php?id=" . $row['PartyMstrID'] . "\" &gt;Edit&lt;/a&gt;";

      // echo "&lt;td&gt;";
      // echo $row['XrefPartyRoleID'];

      echo "&lt;/td&gt;&lt;/tr&gt;";
    }

    echo "&lt;/table&gt;&lt;br/&gt;&lt;br/&gt; ";

    $paginaton  = getPaginationString( $page, $totalitems, $limit,
                    $adjacents  = 1,
                    $targetpage = "adminUserList.php",
                    $pagestring = "?page="
    ); // Functon found in functions.php

    echo $paginaton; 
  ?&gt;
&lt;/td&gt;
</code></pre>

<p>I've spent a lot of time online looking for an explanation without success.  I've switched off the <code>$pagination</code> code line without effect.  I have tried various other tricks and echoed output. The number of rows returned (<code>n</code>) is always correct, but only <code>n-1</code> rows appear in the table.  Any ideas out there?</p>

<p>Thanks - Don</p>
