title: Pagination LAST PAGE link. How to? PHP
body: <p>I created my first successful pagination script following an online tutorial. Here it is:</p>
  
  <pre><code>&lt;?php
  include 'core/database/connect.php';
  $per_page = 6;
  
  $pages_query = mysql_query("SELECT COUNT(`user_id`) FROM `users`");
  $pages = ceil(mysql_result($pages_query, 0) / $per_page);
  
  $page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
  $start = ($page - 1) * $per_page;
  
  $query = mysql_query("SELECT `username` FROM `users` WHERE `active` = 1 LIMIT $start,     $per_page");
  while ($query_row = mysql_fetch_assoc($query)) {
    echo '&lt;p&gt;', $query_row['username'] , '&lt;/p&gt;';
  }
  
  if ($pages &gt;=1 &amp;&amp; $page &lt;=$pages) {
    for ($x=1; $x&lt;=$pages; $x++) {
      echo ($x == $page) ? '&lt;strong&gt;&lt;a href="?page='.$x.'"&gt;'.$x.'&lt;/a&gt;&lt;/strong&gt; ' : '&lt;a     href="?page='.$x.'"&gt;'.$x.'&lt;/a&gt; ';
    }
  }
  ?&gt;
  </code></pre>
  
  <p>My question is: How would I add a link LAST which moves the page to the very last one. FIRST is easy because the link always stays the same members.php?page=1 while the last should look something like... members.php?page=.$last or something of that sort. This is a very noob question but I am a noob programmer. Thanks in advance.</p>
  
  <p>BTW there is no point for jsfiddle because there is no database we can connect to anyways.</p>