SQL Server database created on Navicat Premium, implemented with PHP connection (i.e. PHP connection to Microsoft MSSQL)

Source: Internet
Author: User
Tags sybase

   Can be used in Sybase's Db-lib or Ct-lib library, which also contains an ODBC library. Allows many applications to connect to Sybase or Microsoft's SQL Server;

Using FreeTDS under Windows

What is FreeTDS? FreeTDS is actually an open source (or can be said to be free) C library, it can be implemented under the Linux system Access operation of Microsoft's SQL database. FreeTDS is released as a source of code, and because of this, it can be compiled and installed in almost any system.

If your server is a Windows system, then you should use Php_dblib.dll. (more information with Using FreeTDS for Unix.)

1: Follow the link below to download Php_dblib.dll and save it to the/php/ext folder.

Https://docs.moodle.org/30/en/Installing_MSSQL_for_PHP#Using_the_SQL_Server_2005_Driver_for_PHP_from_Microsoft_on_Windows

2. Add in PHP config file/php/php.ini:

Extension=php_dblib.dll Restart Apache

3: Test:

1    <?  PHP2        $link = mssql_connect (' localhost ', ' db_user ', ' Db_password '); 3        if(!  $link) {4            echo' Could not connect '; 5 die            (' Could not connect: '. mssql_error ()); 6        }7        echo' successful connection '; 8        mssql_close ($link); 9    ?>

OK, successful!!!

Reference: http://www.th7.cn/Program/php/201303/129462.shtml

SQL Server database created on Navicat Premium, implemented with PHP connection (i.e. PHP connection to Microsoft MSSQL)

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.