Php simple paging, php paging. Php simple paging, php paging! DOCTYPEhtmlPUBLIC-W3CDTDXHTML1.0TransitionalENwww.w3.orgTRxhtml1DTDxhtml1-transitional.dtdhtmlxmlnswww.w3.org1 php simple paging, php paging
Untitled Document
$ Conn = mysql_connect ("localhost", "root", "123 ");
Mysql_select_db ("qq", $ conn );
Mysql_query ("set names utf8 ");
$ Length = 5;
$ Pagenum = isset ($ _ GET ['Page'])? $ _ GET ['Page']: 1;
$ Totsql = "select count (*) from q1 ";
$ Totarr = mysql_fetch_row (mysql_query ($ totsql ));
$ Pagetot = ceil ($ totarr [0]/$ length );
If ($ pagenum >=$ pagetot ){
$ Pagenum = $ pagetot;
}
$ Offset = ($ pagenum-1) * $ length;
$ SQL = "select * from q1 order by id limit {$ offset}, {$ length }";
$ Ret = mysql_query ($ SQL );
Echo"
";
Echo"
";While ($ row = mysql_fetch_assoc ($ ret )){Echo"
";Echo"
| {$ Row ['id']} | ";Echo"
{$ Row ['name']} | ";Echo"
{$ Row ['pass']} | ";Echo"
";}Echo"
";
$ Prevpage = $ pagenum-1;
$ Nextpage = $ pagenum + 1;
Echo "up | down ";
Echo" ";
Mysql_close ($ conn );
?>
Http://www.bkjia.com/PHPjc/1091268.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1091268.htmlTechArticlephp simple paging, php paging! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html xmlns = "http://www.w3.org/1...