PHP Connection MSSQL

Source: Internet
Author: User
$link = Mssql_connect ($ip, ' user ', ' password ');

if ($link) {
echo ' yes ';
}else{
Echo ' no ';
}


Output ' no '
I am using Mssql_connect to connect to the remote server. Configuration has been set. Includes the Php.ini.ntwdblib.dll file, and the server allows remote connections. Still not connected yet?
Is there any reason why that person knows?


Reply to discussion (solution)

Http://zhidao.baidu.com/question/276311226.html you look at this link and I want to help you.

I've seen it. Baidu has searched this aspect of the problem. •
Or thank you, huh?

$link = Mssql_connect ($ip, ' user ', ' password ');

if ($link) {
echo ' yes ';
}else{
Echo ' no ';
}


Output ' no '
I am using Mssql_connect to connect to the remote server. Configuration has been set. Includes the Php.ini.ntwdblib.dll file, and the server allows ...









I have encountered this kind of problem, found the relevant package on the foreign website, now share him out, if there is a problem, can contact

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

Landlord use Mssql_connect to connect without reporting grammatical error, obviously not a configuration problem
For the landlord did not give the error message (should echo mssql_get_last_message (), rather than echo ' no ';)
Just guessing.
Confirm that firewall 1433 is turned on
Verify that the user name and password are correct
Confirm that there is only one instance of the target server (otherwise add the instance name to the destination address)

PHP Connection MSSQL Database method, you can refer to the next.

It's a little more than that.

Echo Mysql_error (). "
";

Compare less use!!!

When you install MySQL, you need to choose to allow remote connections

Then I figured it out for myself. Summary of the detailed comprehensive web search
1. First configure the php.ini as usual practice
2. Download the correct version of Ntwdblib.dll (2000.80.194.0), note this version number, if it is 2000.2.8.0 is old. Not supported
3. Ntwdblib.dll Copy to C:\WINDOWS\system32
4. Run SQL Server Configuration Manager: SQL Server Config Manager, open protocol protocols
5. Allow Named pipes "Named Pipes" and "TCP/IP",
6. Restart SQL Server, Apache, and PHP
Connect MS SQL Server 2005 using the following methods:
Mssql_connect (' localhost,1433 ', USERNAME, PASSWORD);


And the version must be correct

  • 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.