title: SELECT statement with sqlsrv_query not returning results
body: <p>I have the following SELECT statement that is 'working' on the SQL Server query tool and returns rows. But, when I run it on PHP, it does not return any rows. I know the connection and the settings are working as when I create a simple query such as "SELECT * from ..." that works. here is my code.</p>
  
  <pre><code>$tsql = "SELECT  [d].[Device_Type_Name],
             [a].[Company_ID] AS [Alliance],
             [a].[Device_Address]
             FROM [dbo].[AL_LKP_User_Device] AS [a]
             INNER JOIN [dbo].[AL_LKP_User] AS [b]
             ON [a].[Login_ID] = [b].[Login_ID]
             INNER JOIN [dbo].[AL_LKP_NOTIFICATION_MASTER_LOG] AS [c]
             ON [b].[Login_ID] = [c].[Login_ID]
             INNER JOIN [dbo].[AL_LKP_Device_Type] AS [d]
             ON [a].[Device_Type_ID] = [d].[Device_Type_ID]";
  
  $stmt = sqlsrv_query( $conn, $tsql);
      if( !$stmt )
      {
          die( print_r( sqlsrv_errors(), true));
      }
  
      $rows = sqlsrv_has_rows($stmt);
       if ($rows === true)
            echo "There are rows. &lt;br /&gt;";
         else
        echo "There are no rows. &lt;br /&gt;";
  </code></pre>
  
  <p>I keep getting the there are no rows when there are actually rows there. Anything that I need to change in the SQL statement??</p>