title: PHP while loop based on MYSQL query results missing out first row
body: <p>I have this php getting rows from my database, however when I while loop the results out into divs on my site, it always misses out the first row it has retrieved, and I have no idea why. </p>
  
  <pre><code>                $db = mysqli_connect('localhost', 'root', '', 'cdb')
                  or die('Error connecting');
  
                  if( isset($_REQUEST['page'])) {
                    $_SESSION['page'] = $_REQUEST['page'];
                  }else{
                    $_SESSION['page'] = 1;
                  }
                  $records_per_page = 8;
  
                  $where =  substr($where, 0, -3);
  
                  $query = "SELECT * FROM cars 
                                ".$where."";
  
                  $result = mysqli_query($db, $query)
                    or die("Error in query: '$query'");
                  $row = mysqli_fetch_assoc($result);
                  $i = 0;
                  $start = ($_SESSION['page'] - 1) * $records_per_page;
                  $end = ($_SESSION['page']) * $records_per_page;
                  while($row = mysqli_fetch_assoc($result) and $i &lt; $end) 
                  {
                    $i++;
                    if( $i &gt; $start ) 
                    {    
                      echo'                   
  
                      &lt;div class="result_main flip'.$i.' shadow2"&gt;
  
                          &lt;div class="main_result_carname"&gt;   
                              &lt;h2&gt;&lt;b&gt;'.$row['make'].' '.$row['model'].'&lt;/b&gt;&lt;/h2&gt;
                          &lt;/div&gt; 
                          &lt;div class="main_result_carprice"&gt;
                              &lt;h2&gt;&lt;b&gt;£'.$row['price'].'&lt;/b&gt;&lt;/h2&gt;
                          &lt;/div&gt;
  
  
                      &lt;/div&gt;';
                    }
                  }
                  ?&gt;
  </code></pre>
  
  <p>Looking at it, I feel it should work fine, but always starts at the 2nd row, the only variable I can see which might affect this is $i. There no reason why it starting at 1 should be wrong, but anyway, making it -1 results in no records showing, and making it 0 makes it stay the same while making it -1 makes it start at the 3rd row, and making it 2 it starts at 2d row.  </p>