The data paging display function is implemented based on PHP, and php implements paging display. The data paging display function is implemented based on PHP. The php implementation page display example in this article shares the PHP implementation code of the data paging display function for your reference, the specific content is as follows: implement the data paging display function based on PHP, and implement paging display by php
The example in this article shares the PHP implementation code of the data paging display function for your reference. The details are as follows:
Implementation code:
User list<? Php $ con = mysql_connect ("localhost", "root", ""); mysql_query ("set names utf8"); mysql_select_db ("zhiye", $ con ); $ pageSize = 1; // The number displayed per page $ rowCount = 0; // Get $ pageNow = 1 from the database; // page number displayed. // If pageNow exists, the first page is displayed by default. If (! Empty ($ _ GET ['pagenow']) {$ pageNow = $ _ GET ['pagenow'];} $ pageCount = 0; // indicates the total number of pages $ sql1 = "select count (id) from user"; $ res1 = mysql_query ($ sql1); if ($ row1 = mysql_fetch_row ($ res1 )) {$ rowCount = $ row1 [0];} // calculates the total number of pages. ceil takes 1 $ pageCount = ceil ($ rowCount/$ pageSize )); // when using SQL statements, note that values should be assigned to some variables. $ Pre = ($ pageNow-1) * $ pageSize; $ sql2 = "select * from user limit $ pre, $ pageSize"; $ res2 = mysql_query ($ sql2 ); while ($ row = mysql_fetch_assoc ($ res2) {echo $ row ['User _ name']."
"; Echo $ row ['name']."
"; Echo $ row ['email ']."
"; Echo $ row ['password']."
"; Echo $ row ['tel']."
";}For ($ I = 1; $ I <=$ pageCount; $ I ++) {echo" $ I ";}?>
The above is all the content of this article. I hope you can give us a reference and support the customer's home.
Examples in this article share the PHP implementation code of the data paging display function for your reference. the specific content is as follows...