How PHP connects and configures the MSSQL database _php tutorial

Source: Internet
Author: User
PHP tutorial How to connect and configure with MSSQL database tutorial
PHP comes with an extended php_mssql.dll connection to SQL Server 2000, which operates with the MSSQL series functions, and operates like MySQL.

1, open the PHP configuration file php.ini, find; Extension=php_mssql.dll remove the semicolon from the front.

2, find mssql.secure_connection = off modified to Mssql.secure_connection = on.

3. Copy the two files under PHP folder Php_mssql.dll and Ntwdblib.DLL to the C:windowssystem32 folder.

4. Restart Apache,ok

*/
With Mssql_connect

$conn =mssql_connect (' localhost ', ' Pandao ', ' 1987 ') or Die (' bkjia.c0m database Not connected ');
mssql_select_db (' Test ', $conn);
Query statement
$Query = "SELECT * FROM News";
$AdminResult =mssql_query ($Query);
Output results
$Num =mssql_num_rows ($AdminResult);
for ($i =0; $i < $Num; $i + +)
{
$Row =mssql_fetch_array ($AdminResult);
Echo ($Row [1]);
Echo ("
");
}

http://www.bkjia.com/PHPjc/630854.html www.bkjia.com true http://www.bkjia.com/PHPjc/630854.html techarticle PHP Tutorial How to connect with the MSSQL Database tutorial to configure PHP's own extension php_mssql.dll connect SQL Server 2000, operate with the MSSQL series functions, and operate the same as MySQL. 1. Open ph ...

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