thinkphp 3.2.3 Connecting SQL Server 2014

Source: Internet
Author: User
Tags sql server driver

Installing the sqlsrv Extension

First SQL Server 2014 installation does not say what the link information set itself

PHP Version: 5.5.12

Sqlsrv Drive Microsoft offers 3.0 and 3.1 version 3.0 corresponding to PHP 5.4 3.1 corresponding to 5.5

PS:WIN7 64-bit system

Download SQL Server Driver
Http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

    • Version 3.0 supports PHP 5.4
    • Version 3.1 supports PHP 5.5


http://www.microsoft.com/en-us/download/details.aspx?id=20098

Note that the official download of the 5.5 driver is not supported 64-bit environment I started using Wampserver 64-bit will not be able to load sqlsrv

Support 64-bit please come here to download the difference is the version 5.5 and 5.6

So here's the 64-bit address download for 5.5 and 5.6

Http://pan.baidu.com/s/1kT5PceN

And then put the download to the file

Php_pdo_sqlsrv_55_nts.dll

Php_pdo_sqlsrv_55_ts.dll

Php_sqlsrv_55_nts.dll

Php_sqlsrv_55_ts.dll

In the PHP installation directory under the EXT directory (ext is php5 after the directory)

PHP Configuration Load Open php.ini Search extension Add the following these please see for yourself php.ini location

extension=php_pdo_sqlsrv_55_nts.dllextension=php_pdo_sqlsrv_55_ts.dllextension=php_sqlsrv_55_nts.dllextension= Php_sqlsrv_55_ts.dll

Restart service does not restart should be able to recognize the

Check whether the load is loaded with the phpinfo () function

The following are the successful

And then just write a test TP3.2.3.

   Public  function  ABC () {        $User = M (' info ', ' dbo. ', ' sqlsrv://sa:[email protected]\mssql/xxx ');          $s =  $User->select ();        Dump ($s);    }

database table Display

Visit: http://localhost:8080/index.php/Home/Category/abc.html

thinkphp 3.2.3 Connecting SQL Server 2014

Related Article

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.