Hi, i need some help to change the pagination of this script. I want to put this digg style pagination: http://www.strangerstudios.com/sandbox/pagination/diggstyle.php My code is: <? if ($_GET['cat']){ // include db include 'include/conn.php'; //sql query $sql = "Select * from TABLE where category = '$_GET[cat]'"; $result = mysql_query($sql); $num_rows = mysql_num_rows($result); $totalpages = ceil($num_rows/30); $curpage = empty($_GET['pg'])?1:$_GET['pg']; if($totalpages>1) { echo "Pages: "; for($loop = 1; $loop<$totalpages+1; $loop++) { if($loop!=$curpage) { ?> [<a href="index.php?&pg=<?php echo $loop; ?>"><?php echo $loop; ?></a>] PHP: That echo will appear all results, i mean if it's 1276 pages it will from [1] [2] till [1276] And i just want like previous| [1][2][3] ... [1274][1275][1276]| next Any person with good skills in php could help me please? Thanks in advance.