Hi I am using a PHP script to connect to SQL Server 2005. After much tinkering around I can finally establish a connection. However when I try and query the database I am getting no response. I have tested my SQL Query on the database and it runs fine. Any help greatly appreciated. Thanks
<?php
/
$serverName = "*******";
$usr="******";
$pwd="****";
$db="*****";
//Connection to Database
$connectionInfo = array("UID" => $usr, "PWD" => $pwd, "Database" => $db);
$conn = sqlsrv_connect($serverName, $connectionInfo);
if( $conn )
{
echo "Connection to database established.
";
}
else
{
echo "Connection could not be established.
";
die( print_r( sqlsrv_errors(), true));
}
//-----------------------------------------------
// Perform operations with connection.
//-----------------------------------------------
$sql = "SELECT ContactName FROM dbo.TBL_JOB WHERE EngineerID = 1 ";
/* Close the connection. */
sqlsrv_close( $conn);
?>