why my pagination link doesnt appear ?

Posted by udaya on Stack Overflow See other posts from Stack Overflow or by udaya
Published on 2010-06-16T05:38:03Z Indexed on 2010/06/16 5:42 UTC
Read the original article Hit count: 143

Filed under:
|

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>';
}
?>

© Stack Overflow or respective owner

Related posts about php

Related posts about pagination