A jump is successful, but the page paging function fails. please kindly advise require_once 'Conn. php ';
$ SQL = "select * from help_relation ";
$ Result = mysql_query ($ SQL );
$ Num = mysql_num_rows ($ result );
$ Pagesize = 2; // set the number of records per page
$ Pages = ceil ($ num/$ pagesize); // get the total number of pages
If ($ pages <1) {$ pages = 1;} // you can specify at least one page for the total number of pages.
$ Page = $ _ GET [page]; // GET the number of pages passed
If ($ page> $ pages) {$ page = $ pages;} // if the transferred page number is larger than the total page number, make it equal to the total page number.
If ($ page <1) {$ page = 1;} // if the passed page number is less than 1, set it to 1.
$ Kaishi = ($ page-1) * $ pagesize; // initial limit record for the next step
If (isset ($ _ GET ['Help _ keyword_id '])! = ''){
$ Help_keyword_id = $ _ GET ['Help _ keyword_id '];
$ SQL = "select * from help_relation where help_keyword_id = '$ help_keyword_id 'Order by help_keyword_id desc limit $ kaishi, $ pagesize"; // retrieve records starting from the calculated initial value, total $ pagesize entries
$ Result = mysql_query ($ SQL); // obtain the result
While ($ row = mysql_fetch_array ($ result ))
{
Echo"\ N ";
// Echo"". $ Row ['id']."\ N ";
Echo"". $ Row ['Help _ topic_id ']."";
Echo"\ N ";
}
}
This is the code
Reply to discussion (solution)
No code passed for page and help_keyword_id
$ Help_keyword_id only exists when there is an passed-in help_keyword_id. will no error be reported when no request is passed in?
So how should we change it? Should we re-write an SQL statement?
Sorry, I am eager to use it. I cannot find it on the Internet.
Are you online? You only do the paging and do not display the page number ~ Of course I can't do it?
Do you want to display the page number?
On the first page, is your current website? Page = 1
You don't have $ page. Is there a problem? You must at least display the first page when judging that the page is empty.
The other $ help_keyword_id is the same. you can GET it through $ _ GET. your link must exist.
Example: www.baidu.com? Page = 1 & help_keyword_id = 15
In this way, you can get it.