I want to display five record per page through pagination (mysql,php,html,css) until all the records are displayed, navigation to pages must be like,
Link is here for demo, click here to experience the result
Here is the code working for me, just change your db name, username and password and get pagination done. You can change $rec_limit value to your desired no. of records per page.
";
$i = 0;
while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) {
if ($i == 0) {
$i++;
echo "";
foreach ($row as $key => $value) {
echo "" . $key . " ";
}
echo " ";
}
echo "";
foreach ($row as $value) {
echo "" . $value . " ";
}
echo " ";
}
echo "";
if( $page > 0 ) {
$last = $page - 2;
echo "Last 5 Records | ";
echo "Next 5 Records";
}else if( $page == 0 ) {
$page = $page + 0;
echo "Next 5 Records";
}else if( $left_rec < $rec_limit ) {
$last = $page - 2;
echo "Last 5 Records";
}
mysql_close($conn);
php?>