PHP Connection MSSQL Database Program _php Tutorial

Source: Internet
Author: User
PHP provides a direct connection to the MSSQL Database command, like a MySQL connection, as I described below.

The following is the ODBC build connection code.

The code is as follows Copy Code

$con = Odbc_connect (' ODBC name ', ' username ', ' password ');

2. Connecting mssql2000

The code is as follows Copy Code

$con = Mssql_connect (' Database address ', ' username ', ' password ');

3. Connecting mssql2008

The code is as follows Copy Code

$connectionInfo = Array ("UID" + user name, "PWD" + = password, "database" + "DB name");
$con = sqlsrv_connect (database address, $connectionInfo);

The above method is very simple I will not introduce, only tell if the connection is not successful we can do the following settings (php.ini file

Extension=php_pdo_mssql.dll; Extension=php_pdo_odbc.dll in front of the semicolon)

http://www.bkjia.com/PHPjc/630727.html www.bkjia.com true http://www.bkjia.com/PHPjc/630727.html techarticle PHP provides a direct connection to the MSSQL Database command, like a MySQL connection, as I described below. The following is the ODBC build connection code. The code below copies the code $con = oDB ...

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