Reputation: 4562
I am looking to connect with SQL Server database from a php application.
$con = mssql_connect('SERVER\SQLEXPRESS2008','','') or die('Could not connect to the server!');
But this gives me the following error
Fatal error: Call to undefined function mssql_connect()
I am using XAMPP in the windows environment and testing with the localhost.
In many examples I found that, it suggests to remove the comment(;) in front of the php_mssql.dll
statement that is there in the php.ini file which resides under php folder.
THIS is one of the tutorials I found and read. The thing is when I search for the text under php.ini I dont find the php_mssql.dll
and no idea why this is. Am I missing something.
Would be really grateful for any help for me to achieve this. Thanks.
Upvotes: 0
Views: 1736
Reputation: 9870
Microsoft has released their own PHP MSSQL drivers. You might need to install them.
Upvotes: 2
Reputation: 21866
To test, write this in your code:
phpinfo();
die;
Then, look over the page and see if the mssql extension is loaded. If not, edit your php.ini and uncomment the part where the mssql extension is loaded. Refresh the page and see if its loaded. If not, go back to the ini, you obviously did something wrong then.
Upvotes: 1