<?php include_once "./pagination.class.php"; $cPage = ( isset($_REQUEST['cPage']) ) ? $_REQUEST['cPage'] : '1'; $sql="SELECT * FROM `tableName` "; $baseURL='index.php?var=2'; // get the HTML paginatio ... $pagination= new gsdPagination($sql,$cPage,'5',$baseURL); // get the query $query = $pagination->rQuery; ?>