title: Why is sqlsrv_fetch_array() returning null?
body: <p>I am trying to make a very simple query to a SQL database using PHP, but no matter what I do, it seems it can't pull any proper results. The following is the code I have written:</p>
  
  <pre><code>$loDate = '2013-10-01';
  $hiDate = '2015-01-01';
  $queryStr = "select TimeCol from dbo.SUBPUMP where TimeCol between " . $loDate . " and " . $hiDate;
  $conn = sqlsrv_connect($serverName, $conInfo);
  $result = sqlsrv_query($conn, $queryStr);
  
  while ($row = sqlsrv_fetch_array($result)) {
      // This never prints.
      echo "row:&lt;br&gt;"; var_dump($row); echo "&lt;br&gt;&lt;br&gt;";
  }
  
  echo "&lt;br&gt;&lt;br&gt;&lt;br&gt;";
  
  // Prints "conInfo: resource(2) of type (SQL Server Connection)"
  echo "conn: "; var_dump($conn); echo "&lt;br&gt;&lt;br&gt;";
  
  // Prints "result: resource(3) of type (SQL Server Statement)"
  echo "result: "; var_dump($result); echo "&lt;br&gt;&lt;br&gt;";
  
  // Prints "row: NULL"
  echo "row: "; var_dump($row); echo "&lt;br&gt;&lt;br&gt;";
  </code></pre>
  
  <p>What I am confused on is how it can establish a proper connection to the database.</p>
  
  <p>Since <code>$conn</code> and <code>$result</code> do not print any errors, but yet do not seem to actually fetch any data for me. </p>
  
  <p>So far, my best guess is that since I am attempting to grab the data from a database through a VPN, and thus might only have a tenuous connection, that the <code>sqlsrv_connect()</code> will attempt to try many times to connect to the database until it receives a single good connection. While the <code>sqlsrv_query()</code> will only attempt this once, and thus fails to gather any data. </p>
  
  <p>Does anyone else have any ideas as to what might be going wrong here?</p>