Select to view content in your preferred language

Connecting to SQL Server

655
0
08-15-2016 12:18 PM
SarojThapa1
Frequent Contributor

We have a database in SQL Server platform in ArcGIS desktop. I am trying to connect to this database using PHP_PDO_SQLSRV. When I try this, I get a fatal error. The codes used to connect to the database:

$serverName = 'SERVERNAME';

$connectionInfo=array('Database'=>'DATABASE', 'UID'=>'USERNAME', 'PWD' => 'PASSWORD');

$conn=sqlsrv_connect($serverName, $connectionInfo);
if($conn){
    echo "Connection to SQL Server is successful! </br>";
}else{
    echo "Connection failed! </br>";
    die(print_r(sqlsrv_errors(),TRUE));
}

I get the following error:

Fatal error: Call to undefined function sqlsrv_connect() in the line $conn=sqlsrv_connect();

Could anyone please help me with this?

Thanks 

Tags (3)
0 Kudos
0 Replies