Paging in PHP is an important one. Here is the sample code for it. Thinks this may help you.
1) First find the total count of records.
2) Set the total records per page.
3) Third parameter as page index.
Then call the php paging function by passing the above values as parameters.
function display_page_links($cur_page,$num_rows,$rows_per_page){
$last_page_no = ceil($num_rows/$rows_per_page);
$link_str = "";
for($i=1; $i<=$last_page_no; $i++):
$link_str .= " ";
if($i==$cur_page):
$link_str .= $i;
else:
$link_str .= "<a href='index.php?cur_page=$i&num_rows=$num_rows' target='_self'>$i</a>";
endif;
$link_str .= " ";
endfor;
echo $link_str;
return;
}


