if ($_GET['startWith']) { $whereAdd[] = "TRIM(LEADING 'THE ' FROM UPPER(P.name)) LIKE UPPER('" . $_GET['startWith'] . "%')"; } $orderBy = $_GET['orderBy']; $limit = $pageStart - 1 . ", " . $numberOfRecords; //get total number of records to print out and calculate page selectors $totalPObj = new Platform(); $totalRecords = count($totalPObj->search($whereAdd, $orderBy, "")); //reset pagestart to 1 - happens when a new search is run but it kept the old page start if ($totalRecords < $pageStart) { $pageStart = 1; } $limit = $pageStart - 1 . ", " . $numberOfRecords; $platformObj = new Platform(); $platformArray = array(); $platformArray = $platformObj->search($whereAdd, $orderBy, $limit); if (count($platformArray) == 0) { echo "<br /><br /><i>Sorry, no platforms or publishers fit your query</i>"; $i = 0; } else { $thisPageNum = count($platformArray) + $pageStart - 1; echo "<span style='font-weight:bold;'>Displaying " . $pageStart . " to " . $thisPageNum . " of " . $totalRecords . " Platform Records</span><br />"; //print out page selectors if ($totalRecords > $numberOfRecords) { if ($pageStart == "1") { echo "<span class='smallerText'><<</span> "; } else { echo "<a href='javascript:setPageStart(1);' class='smallLink'><<</a> "; } //don't want to print out too many page selectors!! $maxDisplay = 41;