List paging display and keyword search
In this section, we will talk about the paging display and keyword search functions.
To do the paging function, we must first connect to the database and obtain data. In most cases we can write paging and search functions in the same php page.
Then let’s analyze the process of the paging function:
First we need to set how many items are displayed on each page and how many pieces of data there are in total, so that we know how many pages there are in total, and This is the page we are currently on.
Let’s compare the code to explain in detail:
$pageCount)?$pageCount:$pageNow+1; //下一页 ?>
We put paging and keyword search on one page.
In our front-end page, we also need to make some changes:
上一页 下一页
The search function needs to cycle out the data we search based on keywords on the front-end page.
The above is the paging and keyword search we introduced. If there is anything you don’t understand, you can leave a message and I will help you answer it in time.