Below is a simple PHP connection MySQL database for data paging display. You can modify it by comment notes, and the SQL statement inside can be changed.
Pay attention to the writing and implementation of the code to be analyzed and observed in the relevant paged part.
php $ link = mysql_connect ('localhost', 'root', '') or Die ('MySQL Database Connect Error'); MySQL_SELECT_DB ('Your Database') OR Die ('The SELECTED DATABASE IS Not EXIST'); ?> // Insert your HTML code here, PHP $ sql = 'select count (*) count from your_table'; $ results = mysql_query ($ SQL) or Die (MySQL_ERRNO (). ":": ".Mysql_ERROR () "/ n"); $ RS = mysql_fetch_object ($ RESULT); $ ReCountCount = $ r-> count; $ show = 20; $ TOTALPAGE = CEIL ($ RecountCount / $ show); $ Page = ($ _ Get ['Page']) && $ _GET ['Page']> = 0)? $ _get ['Page']: 0; $ Islast = ($ Page == ($ TOTALPAGE-1))? True: false; $ Hasnopre = ($ page == 0)? True: false; $ HASNOONEXT = ($ page == $ TOTALPAGE-1)? True: false; $ isfirst = ($ PAGE == 0)? True: false; $ start = $ Page * $ show; mysql_free_result ($ result);> // Insert your HTML code here, <$ sql = "SELECT * from Your_Table Limit $ Start, $ Show "; $ Result = mysql_query ($ SQL) or Die (MySQL_ERRNO ().": ":"); "/ n"); while ($ r = mysql_fetch_object ($ result) {/ / HTML code in this loop is more actually modified Echo $ RS-> Art_ID; echo "
";} mysql_free_result ($ result);?>