According to the steps, PHP still can't connect to SQL Server2005? How to fix it

Source: Internet
Author: User
Follow the steps, PHP still can't connect to SQL Server2005??
1. Download the correct version of Ntwdblib.dll (2000.80.194.0)
2. Configure PHP
A. Open php.in to remove the extension=php_mssql.dll annotation symbol.
B. Open php.in to change mssql.secure_connection = off to ON.
C, copy Php_mssql.dll and Ntwdblib.dll to php.in extension_dir the specified directory or system system32 directory. Restart Apache.
3. SQL Server is configured, restart
PHP Code
  
   
  
   


The result of fail, how to change it??

------Solution--------------------
Mssql_connect (' 127.0.0.1:1433 ', ' sa ', ' sa123 ')
Default ports can generally be omitted
Mssql_connect (' 127.0.0.1 ', ' sa ', ' sa123 ')
------Solution--------------------
The connection string is wrong, not a comma before 1433, but a semicolon.
------Solution--------------------
Put
echo "Fail";
Switch
Echo Mssql_get_last_message ();
------Solution--------------------
It's better with PDO.
  • 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.