PHP Connection query display MSSQL data Instance _php Tutorial

Source: Internet
Author: User
Tags mssql server mysql tutorial php and mysql
PHP Connection query display MSSQL data instance//feel PHP and MySQL MSSQL database processing function is only a different prefix, see the example below to know.

PHP Tutorial Connection query display MSSQL data instance
Feel PHP and MySQL tutorial MSSQL database tutorial processing function is only a different prefix, see the example below to know.

$link = Mssql_connect ("localhost", "sa", "sa") or Die ("Cannot connect to MSSQL server");
mssql_select_db ("Test", $link) or Die ("database connection failed");



Create a MSSQL query statement

$ms _sql = "SELECT * from works where username = ' www.bKjia.c0m '";
$mss _rs = mssql_query ($ms _sql);

if (Mssql_num_rows ($mss _rs))
{
while ($mss _rs = Mssql_fetch_object ($mss _rs))
{
echo "Output value ...";
}
}
Else
{
Echo ' record does not exist ';
}



/*

Indicate:
Mssql_query executing a query
Mssql_num_rows statistics record number of records
Mssql_fetch_object saving data to an object
mssql_select_db Selecting a Database
Mssql_connect Database Connection
This article original in www.bKjia.c0m reprint annotated source

http://www.bkjia.com/PHPjc/630877.html www.bkjia.com true http://www.bkjia.com/PHPjc/630877.html techarticle PHP Connection Query display MSSQL data instance//feel PHP and MySQL MSSQL database processing function is only a different prefix, see the example below to know. PHP Tutorial Connection query display MSSQ ...

  • 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.