That bothered my little brother for a long time paging about the problem

Source: Internet
Author: User
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 "















"while ($row = Mysql_fetch_array ($result)) {echo" "; Echo" "; Echo" "; Echo" "; Echo" ";} echo "
Date Answer Type Quantity
" . $row [' DV ']. "" . $row [' ATL ']. "". $row [' Co ']. "
";

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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.