Can be used in Sybase’s db-lib or ct-lib library, which also contains an ODBC library. Allows many application software to connect to Sybase or Microsoft SQL server;
Use FreeTDS under windows
What is FreeTDS? FreeTDS is actually an open source (or can be said to be free) C library, which can be implemented in Linux Access and operate Microsoft's SQL database under the system. FreeTDS is released as source code, and because of this, it can be compiled and installed on almost any system.
If your server is a Windows system, then you should use php_dblib.dll. (more information on 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. In php Add:
extension=php_dblib.dll to the configuration file /PHP/php.ini Restart apache
3: Test:
1 <?<span>php </span>2 <span>$link</span> = mssql_connect('localhost', 'db_user', 'db_password'<span>); </span>3 <span>if</span>(!<span>$link</span><span>) { </span>4 <span>echo</span>'Could not connect'<span>; </span>5 <span>die</span>('Could not connect: ' .<span> mssql_error()); </span>6<span> } </span>7 <span>echo</span>'Successful connection'<span>; </span>8 mssql_close(<span>$link</span><span>); </span>9 ?>
ok, success!!!
Reference: http://www.th7.cn /Program/php/201303/129462.shtml
The above introduces the SQL Server database created on Navicat premium, and realizes the use of PHP connection, that is, php to connect to Microsoft MSSQL, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.