Jump to content

Fatal Error in mssql_connect


Recommended Posts



i have sql server database and want to connect with PHP 


can any one tell why i get this fatal error when i use mssql_connect :


Fatal error: Call to undefined function mssql_connect() in C:\AppServ\www\esest07\config.php on line 12

(line 12 : 

<$conn = mssql_connect($MyServer, $MyUser, $MyPass);>


i only can connet by odbc_connect , but i dont want use this connection i want mssql_connect  :(


Please help

Link to comment
Share on other sites

You have to enable the MSSQL extension by loading the appropriate .dll via php.ini. This extension however is deprecated and is not even included with PHP in 5.3 and above. Since you are on a windows server, what you should be using is the SQLSRV extension which is available either as a set of functions or as a PDO driver. Have a read over the Requirements and Installation pages in the manual to find out how to get it and set it up.

Link to comment
Share on other sites

thank you very much

i solved it by use php 5.2 and  now mssql is available .


But now i have another problem in character .. my data result is like this : ???????


how can i change characterset  ??


thanks a lot

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.