PHPMSSQL paging instance (refresh) and mssql paging. PHPMSSQL paging instance (refresh), mssql paging? Php * page description: * $ linkmssql_connect (MYSQL2005, sa, 123456) ordie (dblinkerror !. Mssql_error (); mssql_select_db (edu php mssql paging instance (refresh), mssql paging
/*
'Page description:
*/
$ Link = mssql_connect ("MYSQL2005", "sa", "123456") or die ("db link error! ". Mssql_error ());
Mssql_select_db ("edu_dzk", $ link) or die ("db open error! ". Mssql_error ());
// Mssql_query ("set names 'utf8 '");
$ Sqlstrcount = "SELECT count (1) FROM reguser ";
$ Page = $ _ GET ["page"];
If (! Is_numeric ($ page )){
$ Page = "1 ";
}
$ Pagesize = "30 ";
// $ SQL = mysql_query ($ sqlstr );
// $ Totalnum = mysql_num_rows ($ SQL );
$ SQL = mssql_query ($ sqlstrcount );
List ($ totalnum) = mssql_fetch_row ($ SQL );
$ Pagecount = ceil ($ totalnum/$ pagesize );
$ Offset = ($ page-1) * $ pagesize;
$ Sqlstr = "Select top ". ($ pagesize ). "* from reguser where id not in (select top ". ($ page-1) * $ pagesize ). "id from reguser order by id desc) order by id desc ";
$ SQL = mssql_query ($ sqlstr );
$ Result = "";
While ($ result = mssql_fetch_array ($ SQL )){
Echo $ result ["id"].'
';
}
Showpageinfo2 ($ totalnum, $ pagecount, $ page, "& z =". $ z );
Mssql_Close ($ link );
Function showpageinfo2 ($ totalnum, $ pagecount, $ page, $ filster)
{
Echo "total: $ totalnum records, total $ pagecount page, current is the $ page ";
If ($ page! = 1)
{
Echo "homepage ";
Echo "previous page ";
}
If ($ page <$ pagecount)
{
Echo "next page ";
Echo "last page ";
}
}
?>
Http://www.bkjia.com/PHPjc/1119218.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1119218.htmlTechArticlePHP MSSQL paging instance (refresh), mssql paging? Php/* 'page description: */$ link = mssql_connect ("MYSQL2005", "sa", "123456") or die ("db link error! ". Mssql_error (); mssql_select_db (" edu...