Let's take a look at the PHP paging problem! Urgent online

Source: Internet
Author: User
Let's take a look at the PHP paging problem! The values of GET methods such as urgent online have been obtained, but paging is useless. I cannot find any errors after a long time. please wait for a while !!


PHP code:
 '.mysqli_connect_error($conn));    // mysqli_set_charset($conn, "utf8");     if (isset($_GET['page'])){        $_page=$_GET['page'];        echo $_page;         if(empty($_page)){             $_page=1;         }     }else {         $_page=1;     }        $_pagesize=1;    $_pagenum=(page-1)*pagesize;    $sql="SELECT tg_id FROM tg_user";    $result1=mysqli_query($conn,$sql)or die(mysqli_error($conn));    $_num=mysqli_num_rows($result1);    $_pageabsolute=ceil($_num/$_pagesize);//     echo" $_pageabsolute 
"; $query="SELECT tg_id,tg_username,tg_reg_time FROM tg_user ORDER BY tg_reg_time DESC LIMIT $_pagenum,$_pagesize"; $result=mysqli_query($conn, $query); while ($row=mysqli_fetch_array($result)) { echo "{$row['tg_id']}---{$row['tg_username']}---{$row['tg_reg_time']}
"; } mysqli_free_result($result1); mysqli_free_result($result); mysqli_close($conn); ?>

Some HTML code:
 Untitled Document    

    '. ($ I + 1 ).'';} Else {echo'
  • '. ($ I + 1 ).'
  • ';}}?>



Reply to discussion (solution)

$ _ Pagenum = ($ page-1) * $ pagesize;

Kill people with carelessness!

The error information clearly indicates the error phenomenon and location. Why did you turn a blind eye to it?

$ _ Pagenum = ($ page-1) * $ pagesize;

Kill people with carelessness!

The error information clearly indicates the error phenomenon and location. Why did you turn a blind eye to it?


Thank you ~!
For the whole day, I went to find a tofu and don't stop me ~!


No error is reported for zend studio.

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.