"; // get the required number of pages $total_pages = ceil($total_rows / $limit); $pageURL = ""; if($page_number>=2){ echo "
Prev "; } for ($i=1; $i<=$total_pages; $i++) { if ($i == $page_number) { $pageURL .= "
".$i." "; } else { $pageURL .= "
".$i." "; } }; echo $pageURL; if($page_number<$total_pages){ echo "
Next "; } ?>