使用PHP连接到SQL Server 2005

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);
?>

Add the code below after $sql = "SELECT ContactName FROM dbo.TBL_JOB WHERE EngineerID = 1 ";:

$stmt = sqlsrv_query($conn, $sql );
if ($stmt === false) {
     die(print_r(sqlsrv_errors(), true));
}

while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {
      echo $row['ContactName']. "<br />";
}

sqlsrv_free_stmt($stmt);