1

May is ask you about how to connect to Microsoft SQL server 2005 enterprise using PHP.

I am using Appserv 2.5.10 ( Apache 2.2.8, PHP 5.2.6) and SQL server 2005

After I place the extension download from this link :

http://www.microsoft.com/en-us/download/details.aspx?id=20098

enable the php.ini file by adding these lines.

extension=php_pdo.dll
extension=php_sqlsrv_52_ts_vc6.dll
extension=php_pdo_sqlsrv_52_ts_vc6.dll

Restart Apache using this code to connect

$link = mssql_connect($server, $user, $pass);

Error shown in browser is

Fatal error: Call to undefined function mssql_connect() in G:\AppServ\www\testmssql_connect.php on line 12

can anyone help me ?

NOTE: i am using windows server 2003 and i don't found this OS in OS supporting list of Microsoft Driver 3.0 for PHP. Is this issue cause the problem ?

1 Answer 1

1

Look at this link:

1) Check your PHP.INI file's extension_dir

2) Make sure you copied your .dlls into that directory (for example, into C:\PHP\ext").

3) Create a dummy page to call phpinfo();. Display the page in a browser. Make sure you see entries for "sqlsrv".

'Hope that helps!

Sign up to request clarification or add additional context in comments.

2 Comments

why i type sqlsrv_connect () this function has the black text color instead of blue color (because of function) so should i use sqlsrv_connect or mssql_connect
The new 3.0 API uses sqlsrv_connect(). I really find it shocking that people put such faith in their IDE, vs. understanding what the actual code is doing and how it works. There is not necessarily any "tight binding" between the IDE and the underlying implementation. The current MSSQL 3.0 driver documentation is here: php.net/manual/en/book.sqlsrv.php and blogs.msdn.com/b/sqlphp/archive/2011/09/24/…. Please do follow the steps above to make sure everything's configured correctly. 'Hope that helps...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.