Home >Backend Development >PHP Problem >What are the steps for php pagination
Steps for PHP paging:
First, download and open the decompression package of the PHP paging class and open it as shown below:
Related recommendations: "PHP Getting Started Tutorial"
Open the config.php file and deploy it as follows:
$host="数据库路径"; $db_user="管理员账号"; $db_pass="管理员密码"; $db_name="数据库名称";
Please According to actual needs, configure the above 4 items, as shown below:
Open the fenye.php (front-end) file, and enter $tablename (the name of the database table to be queried), $ showrow (the number of records displayed per page) is set, and the other parameters do not need to be set.
After the above steps are completed, we can deploy paging where needed. The code is as follows:
<?php //实例化分页类并输出分页 $fenye = new page($total,$showrow,$curpage,$purl); echo "<div class='fenye'>".$fenye->myde_write()."</div>"; ?>
You only need to display paging where the page needs to be Paste the above code to see the effect.
Finally, let’s take a look at the effect of successful deployment, as shown below:
At this point, we have completed paging The deployment is working.
The above is the detailed content of What are the steps for php pagination. For more information, please follow other related articles on the PHP Chinese website!