Location: PHPKode > scripts > PHP Class For Paging > nice_paging/sample3.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
	<title>Nice Paging - Number Of Links Per Page</title>
	<link rel="stylesheet" type="text/css" href="css/styles.css" />
// Include class

// Configuration file

// Connect to database
$con=mysql_connect($host, $user, $password);
mysql_select_db($database, $con);

// Create instance
$paging=new nicePaging($con);

// Create table
echo '<table border="0" cellspacing="1" cellpadding="3" width="500" align="center" class="table">';
	echo '<tr class="header"><th width="50">ID</th><th width="450">Title</th></tr>';
	$rowsPerPage=10; // Rows per page
	// Pager query
	$result=$paging->pagerQuery("SELECT id, title FROM sample", $rowsPerPage);
		// Display row
		echo '<tr class="row"><td>'.$data['id'].'</td><td>'.$data['title'].'</td></tr>';
echo '<table>';

$link="sample3.php"; // Page name

$paging->setMaxPages(4); // Number of paging links that will be displayed per page

// Create links for paging
echo $paging->createPaging($link);

// Close database connection
Return current item: PHP Class For Paging