PHP connection MSSQL

Source: Internet
Author: User
PHP connection MSSQL $ link = mssql_connect ($ ip, 'user', 'password ');

If ($ link ){
Echo 'yes ';
} Else {
Echo 'no ';
}


Output 'no'
I am using mssql_connect to connect to a remote server. All configurations are set. Including the php. ini. ntwdblib. dll file and the remote connection allowed by the server. Cannot connect now?
Does anyone know why?


Reply to discussion (solution)

Http://zhidao.baidu.com/question/276310926.htmlyou can see this chain hope you can help

I have read it. Baidu has searched this issue. ··
Thank you.

$ Link = mssql_connect ($ ip, 'user', 'password ');

If ($ link ){
Echo 'yes ';
} Else {
Echo 'no ';
}


Output 'no'
I am using mssql_connect to connect to a remote server. All configurations are set. Including the php. ini. ntwdblib. dll file and the server permission ......









I have encountered this kind of problem. I found the related package on a foreign website and shared it with me. if you have any questions, contact me.

Http://download.csdn.net/detail/sosqrn975/5169189

The main user uses mssql_connect for connection without syntax error. it is obviously not a configuration problem.
The error message is not provided by the landlord (echo mssql_get_last_message () instead of echo 'no ';)
I can only guess
Check that firewall 1433 is enabled
Confirm that the user name and password are correct
Check that the target server has only one instance (otherwise, the instance name must be added to the target address)

For how to connect PHP to the mssql database, refer.

This is rarely used ~

Echo mysql_error ()."
";

It is rarely used !!!

When installing mysql, you must select Allow remote connection

Then I figured it out myself. Summary of detailed integrated network search
1. configure php. ini as usual
2. download the correct version of ntwdblib. dll (2000.80.194.0). Note that this version number is Old if 2000.2.8.0 is used. Not supported
3. copy ntwdblib. dll to C: \ WINDOWS \ system32
4. run SQL Server Configuration Manager: SQL Server Configuration Manager to enable Protocols.
5. allow named pipelines "named pipes" and "TCP/IP ",
6. restart SQL Server, Apache, and PHP
Connect to ms SQL Server 2005 using the following methods:
Mssql_connect ('localhost, 100', USERNAME, PASSWORD );


And the version must be correct.

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.