Asking for help bothered me for a long time on the paging issue
My page fixed value is the display is normal, the page display is normal, but once the assignment (I want others to enter the date, can automatically go to find the information of that month), it is not, the first page is normal, the second page is not normal display, I think the value is not transmitted to the next page, but I will not change AH ~ please help
The manager is running out of patience ~ I'm going crazy,
Enter Date page, scym.php
<title>Date</title>
Show Page, szym.php
<title>Data</title>
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_ti Me), Answer_type limit $offset, $Page _size ";
$result =mysql_query ($sql);
echo "
" ." Data Sheet ($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;//page number
$pageoffset = ($page _len-1)/2;//page number offset
$key = ";
$key. = " $page/$pages"; Page, total pages
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 Max page count
if ($page + $pageoffset >= $pages + 1) {
$init = $pages-$page _len+1;
}else{
Calculations when left and right offsets are present
$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