PHP Pagination for 1,2,3... vs 1,2,3,4,5,etc
Do you just mean the links at the bottom of your page? If so you have this code:

// Display page links.
$numOfPages = ceil($rowsReturned/$rowsPerPage);
for($i = 1; $i&lt;=$numOfPages; $i++)
{
    $pageLink = "?pageNum=$i";
    print("&lt;a href=$pageLink&gt;$i&lt;/a&gt;&amp;nbsp;&amp;nbsp;");
}


Modify this to render just  the first three links, then your ellipses (...) separator and then the final page number.

EDIT to add pseudo code
This is messy but hopefully gives you the idea, create your function, make it work and then post a new question asking how to make it prettier (for example tidy up the ifs, add logic to only render a single set of ellipses, don't repeat any rendering code).

$numOfPages = ceil($rowsReturned/$rowsPerPage);
$renderedEllipses = false;
for($i = 1; $i&lt;=$numOfPages; $i++)
{
    //If you always want to render pages 1 - 3
    if($i &lt; 4) {
        //render link
    }

    //If you always want to render current page number
    else if($i == $pageNum) {
        //render link
        //reset ellipses
        $renderedEllipses = false;
    }

    //if you always want the last page number
    else if ($i == $numOfPages - 1) {
        //render link
    }

    //make sure you only do this once per ellipses group
    else {
      if (!$renderedEllipses){
          print("...");
          $renderedEllipses = true;
      }
    }
}


EDIT added ellipses test
The $renderedEllipses flag will stop hundreds of ellipses being rendered.