For help, the paging problem that has plagued me for a long time is that the pagination value is displayed normally and the paging display is normal, but once assigned a value (I want someone to enter a date, can automatically go to the information that month), it will not work, the first page is normal, the second page will not be displayed normally, I think the value is probably not passed to the next page, but I won't change it ~ Please help. The manager is impatient ~ I'm crazy. entering the date page, scym. php & lt; h for help, has plagued my paging problems for a long time.
My paginated values are displayed normally, but pages are displayed normally, but once assigned values (I want others to enter the date, they can automatically find the information for that month), it will not work, the first page is normal, and the second page cannot be displayed normally. I think the value is not uploaded to the next page, but I will not change it ~ Please help
The manager is impatient ~ I'm going crazy,
Enter the date page, scym. php
Date
Display Page, szym. php
Data
Include ("conn. php ")
?>
$ Rql = $ _ POST [rq];
$ Page_size = 15;
$ Results = mysql_query ("select date (visit_time) as dv, answer_type as atl, count (1) as co from om_log_ask_detail _ $ rql group by date (visit_time), answer_type ");
$ Count = mysql_num_rows ($ results );
$ Page_count = ceil ($ count/$ Page_size );
$ Init = 1;
$ Page_len = 5;
$ Max_p = $ page_count;
$ Pages = $ page_count;
If (empty ($ _ GET ['Page']) | $ _ GET ['Page'] <0 ){
$ Page = 1;
} Else {
$ Page = $ _ GET ['Page'];
}
$ Offset = $ Page_size * ($ page-1 );
$ SQL = "select date (visit_time) as dv, answer_type as atl, count (1) as co from om_log_ask_detail _ $ rql group by date (visit_time), answer_type limit $ offset, $ Page_size ";
$ Result = mysql_query ($ SQL );
Echo "". "data ($ rql )"."";
Echo"
| Date |
Answer type |
Quantity |
";While ($ row = mysql_fetch_array ($ result )){Echo"
";Echo"
| ". $ Row ['dv']." | ";Echo"
". $ Row ['atl ']." | ";Echo"
". $ Row ['Co']." | ";Echo"
";}Echo"
";
Mysql_close ($ con );
?>
$ Page_len = ($ page_len % 2 )? $ Page_len: $ pagelen + 1; // Number of page numbers
$ Pageoffset = ($ page_len-1)/2; // page number offset between left and right
$ Key = '';
$ Key. = "$ page/$ pages"; // page
If ($ page! = 1 ){
$ Key. = "first page"; // first page
$ Key. = "previous page"; // Previous Page
} Else {
$ Key. = "first page"; // first page
$ Key. = "previous page"; // Previous Page
}
If ($ pages> $ page_len ){
// If the current page is less than or equal to the left offset
If ($ page <= $ pageoffset ){
$ Init = 1;
$ Max_p = $ page_len;
} Else {// if the current page is greater than the left offset
// If the right offset of the current page number exceeds the maximum page number
If ($ page + $ pageoffset >=$ pages + 1 ){
$ Init = $ pages-$ page_len + 1;
} Else {
// Calculation when both the left and right offsets exist
$ Init = $ page-$ pageoffset;
$ Max_p = $ page + $ pageoffset;
}
}
}
For ($ I = $ init; $ I <= $ max_p; $ I ++ ){
If ($ I = $ page ){
$ Key. = ''. $ I .'';
} Else {
$ Key. = "". $ I ."";
}
}
If ($ page! = $ Pages ){
$ Key. = "next page"; // Next page
$ Key. = "Last page"; // Last Page