Beginner's simple PHP paging problems, but I don't know why not paging

Source: Internet
Author: User
Beginner's simple PHP paging problem, but I don't know why not paging? PHPcode & lt ;? Functionpager ($ rows, $ page_size) {global $ page, $ select_from, $ select_limit, $ pagenav; $ page_count = ceil (simple PHP paging problem for beginners in $ ro, but I don't know why not paging?
PHP code
  
  = $ Page_count) $ page = $ page_count; $ select_limit = $ page_size; $ select_from = ($ page-1) * $ page_size. ','; $ pre_page = ($ page = 1 )? 1: $ page-1; $ next_page = ($ page = $ page_count )? $ Page_count: $ page + 1; $ pagenav. = "$ page/$ page_count page $ rows records"; $ pagenav. = "homepage"; $ pagenav. = "previous page"; $ pagenav. = "next page"; $ pagenav. = "Last page"; $ pagenav. = "Jump\ N "; for ($ I = 1; $ I <= $ page_count; $ I ++) {if ($ I = $ page) $ pagenav. ="$ I\ N "; else $ pagenav. ="$ I\ N ";}}include (" conn. php "); //// // calculate the record from $ select_from by using the pager function start retrieval, $ pagenav output paging navigation $ rows = mysql_num_rows (mysql_query ("select * from manager ")); echo $ rows; pager ($ rows, 2); $ SQL = "select * from manager limit $ select_from $ select_limit"; echo $ SQL; $ rst = mysql_query ($ SQL ); while ($ row = mysql_fetch_array ($ rst) {?>                    
            
            
            
            
            
            
            
            
            
            
  


The specific page number is calculated, that is, clicking the next page cannot be used to flip the page, which is very depressing.

------ Solution --------------------
Where is the variable $ page used in the pager function assigned a value?

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.