Skip to content
Advertisement

MSSQL DATABASE CONNECTION WITH PHP

Please i am trying to connect to an mssql database on a different machine. Below is my code but i just keep getting a blank page.

I dont know what the issue may be. i have installed php and the mssql drivers.

JavaScript

Advertisement

Answer

I would suggest that you display the connection error using sqlsrv_errors().

Load the PHP drivers in php.ini file and restart the server.

JavaScript

Please see the following example:

JavaScript

For more info: http://php.net/manual/en/function.sqlsrv-connect.php

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement