Php connection mssql database project_php tutorial-PHP Tutorial

Source: Internet
Author: User
Php connects to the mssql database program. Php provides commands for directly connecting to the mssql database, just like connecting to mysql. I will introduce them below. The following is the odbc Connection creation code. The code is as follows: Copy the code $ conodb php to provide commands for directly connecting to the mssql database, just like connecting to mysql. I will introduce it below.

The following is the odbc Connection creation code.

The code is as follows:

$ Con = odbc_connect ('odbc name', 'username', 'password ');

2. connect to mssql2000

The code is as follows:

$ Con = mssql_connect ('database address', 'username', 'password ');

3. connect to mssql2008

The code is as follows:

$ ConnectionInfo = array ("UID" => username, "PWD" => password, "Database" => "Database name ");
$ Con = sqlsrv_connect (database address, $ connectionInfo );

The above method is simple and I will not introduce it. it only describes the settings (php. ini file) if the connection fails.

Medium; extension = php_pdo_mssql.dll; remove the semicolon before extension = php_pdo_odbc.dll)

Bytes. The following is the odbc Connection creation code. The code is as follows $ 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.