PHP MSSQL can refresh paging instances

Source: Internet
Author: User
Tags mssql server
This article mainly introduces the PHP MSSQL can be refreshed paging instance, and Php+mssql General page formula, interested in the small partners can refer to

Examples of this article for everyone to share the PHP MSSQL can refresh page instances, the specific content is as follows

<?php/* ' 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 = "";//$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 isn't in (select top.) ($page-1) * $pagesize). "ID from Reguser ORDER BY id DESC", ORDER BY id Desc ", $sql =mssql_query ($sqlstr); $result =" "; while ($re Sult=mssql_fetch_array ($sql)) {echo $result ["id"]. ' <br> ';} 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 first $page page"; if ($page!=1) {echo]<a href=?page=1$filster> Home </a> "; echo "<a href=?page=". ($page-1). " $filster > Prev </a> ";} if ($page < $pagecount) {echo "<a href=?page=". $page + 1). " $filster > Next </a> "; echo "<a href=?page= $pagecount $filster> end </a>";}}? >

Below for everyone to share the Php+mssql General page formula, for your reference, the specific content as follows

<?php//phpinfo ();//$conn =mssql_connect (' 192.168.0.3 ', ' app ', ' web ') or Die (Mssql_get_last_message ());//if ($conn //{//?echo "Success";//}else{//?echo "fail";//}?>

Summary: The above is the entire content of this article, I hope to be able to help you learn.

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.