title: Page Prev/Next of PHP MYSQL
body: <p>I am writing a simple script using PHP/MySQL for records and I saved records and it's working perfectly.</p>
  
  <p>My problem is that I need to show 4 records only and have a pager to go to next/prev pages.</p>
  
  <p>Can someone give me a code please?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>$result = mysqli_query($con,"SELECT * FROM products Where username='$_SESSION[username]' LIMIT 0, 4");
  
  
  while($row = mysqli_fetch_array($result))
  {
    echo "&lt;tr&gt;";
    echo "&lt;td width='25%'&gt;". $row['serial'] . "&lt;/td&gt;";
    echo "&lt;td&gt;&lt;img width='65' height='65' src='upload/".$row['image']."'&gt;&lt;/td&gt;";
    echo "&lt;td width='25%'&gt;". $row['arrive'] . "&lt;/td&gt;";
    echo "&lt;td width='25%'&gt;". $row['size']; "&lt;/td&gt;";  
    echo "&lt;/tr&gt;";
  }
  echo "&lt;/table&gt;";
  </code></pre>