I have an 300 rows(data) each page contain 10 records I need first 10 pages then click next then display next 10 page here is my code:
<?php
$eu = ($start - 0);
$limit = 10;
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if ($nume > $limit)
{
echo'<div class="pagination right">';
if ($back >= 0)
{
echo"<a href='$page_name?start=$back&o" . $_SESSION['clicked'] . "&p=$desc'>«</a>";
}
$i = 0;
$l = 1;
for ($i = 0; $i < $nume; $i = $i + $limit)
{
if ($i <> $eu)
{
echo"<a href='$page_name?start=$i&o=" . $_SESSION['clicked'] . "&p=$desc'>$l</a>";
}
else
{
echo "<a class='active'>$l</a>";
}
$l = $l + 1;
}
if ($this1 < $nume)
{
echo "<a href='$page_name?start=$next&o=" . $_SESSION['clicked'] . "&p=$desc'>»</a>";
}
echo '</div>';
}
echo '</div></div>';
?>
Then I will get response like this http://app.ologie.us/app/admin/Screen.png
Can any one please guide to effective paging in PHP.
Here's a tutorial on basic pagination.