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.