Coding & Programming > PHP Forum

How Create a Pagination in PHP coding?

(1/2) > >>

qx_1789:
How Create a Pagination in PHP coding?

TomClarke:
Hello!
I found a great article for you http://www.onlinetuting.com/pagination-in-php-mysqli/
You can read about all steps how create a pagination in PHP.

Rashikasaxena:
Its always possible that your SQL select statement query may result into thousand of record. But its not good idea to display all the results on one page.

denisebr:
Below is the code for Pagination with PHP
$perpage = 5;

if(isset($_GET["page"])){
$page = intval($_GET["page"]);
}
else {
$page = 1;
}
$calc = $perpage * $page;
$start = $calc - $perpage;
$result = mysqli_query($conn, "select * from post Limit $start, $perpage");

$rows = mysqli_num_rows($result);

Lishmalinyjames:
Create a database and table. Provide a list of records in the table.
Connect with the MySQL database.
Create the pagination link to split the data into multiple pages and add them to the bottom of the table.
Fetch data from the database and display it on multiple pages.

Navigation

[0] Message Index

[#] Next page

Go to full version