Hi Chaps, I have a Query, that selects data from MySQL database: $maxRows_rsShop = 20; $pageNum_rsShop = 0; if (isset($_GET['pageNum_rsShop'])) { $pageNum_rsShop = $_GET['pageNum_rsShop']; } $startRow_rsShop = $pageNum_rsShop * $maxRows_rsShop; $colname_rsShop = "-1"; if (isset($_GET['shop'])) { $colname_rsShop = $_GET['shop']; } mysql_select_db($database_dbconnect, $dbconnect); $query_rsShop = sprintf(" SELECT tbl_shop.shop_title, tbl_product.prod_id, tbl_product.prodtitle, tbl_product.prod_shop_thumb, tbl_product.prod_price, tbl_product_type.prod_type_title, tbl_product_type.prod_type_plural, SUM(tbl_product_type.prod_type_id) as quantity, img_name FROM tbl_shop_has_prod INNER JOIN tbl_shop ON tbl_shop.shop_id=tbl_shop_has_prod.FK_shop_id INNER JOIN tbl_product ON tbl_product.prod_id=tbl_shop_has_prod.FK_prod_id INNER JOIN tbl_product_type ON tbl_product_type.prod_type_id=tbl_product.FK_prod_type_id INNER JOIN tbl_product_has_size ON tbl_product_has_size.FK_prod_id=tbl_product.prod_id INNER JOIN tbl_web_img ON tbl_web_img.FK_shop_id=tbl_shop.shop_id WHERE shop_id=%s AND prod_quantity > 0 GROUP BY shop_id, prod_id ORDER BY prod_added DESC", GetSQLValueString($colname_rsShop, "int")); $query_limit_rsShop = sprintf("%s LIMIT %d, %d", $query_rsShop, $startRow_rsShop, $maxRows_rsShop); $rsShop = mysql_query($query_limit_rsShop, $dbconnect) or die(mysql_error()); $row_rsShop = mysql_fetch_assoc($rsShop); if (isset($_GET['totalRows_rsShop'])) { $totalRows_rsShop = $_GET['totalRows_rsShop']; } else { $all_rsShop = mysql_query($query_rsShop); $totalRows_rsShop = mysql_num_rows($all_rsShop); } $totalPages_rsShop = ceil($totalRows_rsShop/$maxRows_rsShop)-1; $queryString_rsShop = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_rsShop") == false && stristr($param, "totalRows_rsShop") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_rsShop = "&" . htmlentities(implode("&", $newParams)); } } $queryString_rsShop = sprintf("&totalRows_rsShop=%d%s", $totalRows_rsShop, $queryString_rsShop); Code (markup): I have 'Move to Fist Page', 'Move to Previous Page', 'Move to Next Page', 'Move to Last Page' links that work OK, but what I'm after is page numbering links so the user knows how many pages there are, i.e.: 1, 2, 3. Can anyone help / point me in the right direction? Cheers
Integrate the following: <?php $out = ''; foreach(range(1, $last_page) as $num) { $out .= "<a href=\"?pg={$num}\">{$num}</a> | "; } echo rtrim($out, " | "); ?> PHP: However what would work better would be a better pagination, theirs some good pagination classes out their.