This is my script which i have used to paginate ,,The datas are restricted to 4 but the pagination link doesn't appear
<?
require_once ('Pager/Pager.php');
$connection = mysql_connect( "localhost" , "root" , "" );
mysql_select_db( "ssit",$connection);
$result=mysql_query("SELECT dFrindName FROM tbl_friendslist", $connection);
$row = mysql_fetch_array($result);
$totalItems = $row['total'];
$pager_options = array(
'mode' => 'Sliding', // Sliding or Jumping mode. See below.
'perPage' => 4, // Total rows to show per page
'delta' => 4, // See below
'totalItems' => $totalItems,
);
$pager = Pager::factory($pager_options);
echo $pager->links;
list($from, $to) = $pager->getOffsetByPageId();
$from = $from - 1;
$perPage = $pager_options['perPage'];
$result = mysql_query("SELECT * FROM tbl_friendslist LIMIT 5 , $perPage",$connection);
while($row = mysql_fetch_array($result))
{
echo $row['dFrindName'].'</br>';
}
?>