Home  >  Article  >  Backend Development  >  Warning: mssql_connect() [function.mssql-connect]:_PHP教程

Warning: mssql_connect() [function.mssql-connect]:_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:53:591134browse

warning: mssql_connect() [function.mssql-connect]:
This is what I did. It is OK to make sure mssql is a normal username and password, but the following does not work.

$con=mssql_connect( "localhost", "sa ", "123456 ") or die ('error');

?>

Error message
warning: mssql_connect() [function.mssql-connect]: unable to connect to server: $sa in d:php2.php on line 11
error

Let’s take a look at my solution,
The system is:
win2003+mssql2000+php5.23

Implementation method

Is there ntwdblib.dll in the php directory? Is there this file? ntwdblib.dll is the customer connection library. If you check the version number, it will usually be 7.0. This can only be connected with mssq 7.0. We are here to If the version of our current database tutorial is the same, copy ntwdblib.dll under mssql to the directory where your php is located and replace the 7.0 one. Restart iis and it will be ok


Interlude, if there is a problem with your mssql connection, you can use PHP's built-in function mssql_get_last_message() to get the error message.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632354.htmlTechArticlewarning: mssql_connect() [function.mssql-connect]: I did this to make sure mssql is normal Username and password are also OK, but the following is not possible. ?php tutorial $con=mssql_connect( lo...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn