The problem of connecting php to mssql Warning: mssql_connect () [function. mssql-connect]: I have configured PHP5 & nbsp under IIS, but there is always a prompt that Mssql cannot be connected. & Nbsp; my test procedure is as follows: & nbsp; & lt ;? Php & nbsp; $ conmssql_connect (& quot; localhost php connection mssql problem Warning: mssql_connect () [function. mssql-connect]:
I have configured PHP5 under IIS
However, there is always a prompt that Mssql cannot be connected.
My test procedure is as follows:
$ 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: \ php \ 2.php on line 11
Error
Why! I have used all the online methods! Php is also configured, the semicolon is removed, and the two files are also placed under system32!
Urgent! Thank you!
------ Solution --------------------
"Sa", "123456"
Try to remove spaces. no, print out the error code.
------ Solution --------------------
When the connection fails, mssql_get_last_message () should have information.
------ Solution --------------------
Don't understand, but try removing useless spaces. there are spaces behind your sa, and there are spaces behind 123456, and there are also spaces above localhost. if you do, try removing them.
PHP code
$ Con = mssql_connect ("localhost", "sa", "123456") or die ('error ');
------ Solution --------------------
After configuration, run phpinfo (). if MSSQL exists, install the SQL database on your computer and start the SQL manager;
If there is still no connection, I will give you a link of my own mssql php class library for you to use http://download.csdn.net/source/2691449
------ Solution --------------------
Post the solution to this problem.
------ Solution --------------------
The SQL server configuration is incorrect.