You want to add the home page and the last page to the page
";} Else {echo"";} If ($ row ['Surplus '] = 0) $ ss =" not available "; else $ ss =" optional "; echo" ". $ Row ['id']."
". $ Row ['subobject']."
". $ Row ['teacher']."
". $ Row ['zhicheng']."
". $ Row ['Number']."
". $ Row ['xuehao']."
". $ Ss ."
View
"; $ N ++ ;}?>
Reply to discussion (solution)
The content is wrong. the content below should be paginated. I want to add a homepage and a last page.
There are currently a total of ". $ count." records Total ". $ pages." pages"; If ($ offset) {$ preoffset = $ offset-$ list_num; print"Previous Page";} Else {echo"Previous Page";}$ Newoffset = $ offset + $ list_num; if ($ pages! = 0) & ($ newoffset/$ list_num )! = $ Pages) {print ("Next page");} Else {echo"Next page";}$ Pageno = ($ offset/$ list_num) + 1; echo"ThePage ";?>
Print"HomepagePrevious Page";}
Print ("Next pageLast page");
Actually, the two print statements are written differently ...... Alas, there is a lot of room for improvement
Print"HomepagePrevious Page";}
Print ("Next pageLast page");
Actually, the two print statements are written differently ...... Alas, there is a lot of room for improvement. I also want to ask questions about the last page. There are also 6 added to my list. after I add the statements on the last page, after clicking "last page", the system does not display the content on page 6th. Instead, it only displays a list header and displays the (6.666667) page on the () page, what's going on?
Your total number of pages is your last number of pages
The total page number here is $ pages, so the last page number is also $ pages
You should calculate this clearly. if the number of decimal places is + 1
$ Pages = ceil ($ count/$ list_num); the total number of pages here is correct, but you must judge that $ list_num cannot be 0.
Your total number of pages is your last number of pages
The total page number here is $ pages, so the last page number is also $ pages
You should calculate this clearly. if the number of decimal places is + 1
$ Pages = ceil ($ count/$ list_num); the total number of pages here is correct, but make sure that $ list_num cannot be 0. sorry, I am a newbie, so I want to add a question: I have defined $ list_num to be equal to 30. Why can't I judge it as 0? And how should I write my last page statement? If I write>Last pageThen it jumps to the (1.2) page.
Your total number of pages is your last number of pages
The total page number here is $ pages, so the last page number is also $ pages
You should calculate this clearly. if the number of decimal places is + 1
$ Pages = ceil ($ count/$ list_num); the total number of pages here is correct, but make sure that $ list_num cannot be 0. sorry, I am a newbie, so I want to add a question: I have defined $ list_num to be equal to 30. Why can't I judge it as 0? And how should I write my last page statement? If I write>Last pageThen it jumps to the (1.2) page.
It's good to have a definition, but how do you calculate the decimal number? Ceil, but this is an integer.
$ Pageno = ($ offset/$ list_num) + 1;
Why do you need to calculate this?
Shouldn't your text box be the current page by default? Even if it is not the current page, shouldn't it be recalculated here? Even if you want to calculate it again, you need to take an integer.
There is a large comment in the first part of the php page. how can I find out which one was written,
The content of the comment is as follows:
$ Pageno = ($ offset/$ list_num) + 1;
Why do you need to calculate this?
Shouldn't your text box be the current page by default? Even if it is not the current page, shouldn't it be recalculated here? Even if you want to recalculate it, you need to take an integer. Should I remove this sentence?
$pageno=($offset/$list_num)+1;
Then, change page $ pageno to page $ pages?
$ Pageno = floor ($ offset/$ list_num) + 1); // change it to this pattern.
$ Pageno = floor ($ offset/$ list_num) + 1); // you can skip to the last page, but only the header of the list is displayed on the last page.
$ Pageno = ceil ($ offset/$ list_num );
Ceil returns the smallest integer greater than or equal to $ offset/$ list_num.
$ Pageno = ceil ($ offset/$ list_num );
Ceil gets the smallest integer greater than or equal to $ offset/$ list_num. well, the problem is that the 1st page displays 0th pages. I still don't need the last page function.