title: sqlsrv_fetch_array returns true in php
body: <p>So, I've had this problem before and never solved it but now I got it again and I really want it to be solved.</p>
  
  <p>In a PHP file I execute the following lines:</p>
  
  <p>The problem is in the querySelect() which you can see down below..</p>
  
  <pre><code>$stmt = sqlsrv_query($dbconn, "SELECT * FROM USERS");
  $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC );
  Logger::logg("ROW (not in method): " . var_export($row, true), LV);
  
  querySelect("SELECT * FROM USERS",$dbconn);
  </code></pre>
  
  <p>And I get the following:
  (The first output is correct and selects the first user and as you can see returns an associcative array). Then in querySelect $row is true each time. (there is more outputs of this because it does it for each user ofcourse...)</p>
  
  <pre><code>07/25/12 12:11:26 - ROW (not in method): array (
    'LopNr' =&gt; 1,
    'Mail' =&gt; 'xxxx                                                                                            ',
    'Password' =&gt; 'xxx',
    'Auth' =&gt; '1',
    'DisplayName' =&gt; 'xxx            ',
    'sdsd' =&gt; xx,
    'sdsd' =&gt; 'xxx',
    'ts' =&gt; 1342093599,
    'Cell' =&gt; NULL,
    'WantsSMS' =&gt; xxx,
  ).
  07/25/12 12:11:27 - Query: SELECT * FROM USERS.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  07/25/12 12:11:27 - ROW: true.
  </code></pre>
  
  <p>querySelect is implemented like this:</p>
  
  <pre><code>function querySelect($query, $dbconn, $fetchLimit = 1000000)
  {
      $stmt = sqlsrv_query($dbconn, $query);
      Logger::logg(LOGG_QRY_ERR_VERBOSE . $query, LV);
      if ( !$stmt )
      {
          Logger::logg(LOGG_QRY_ERR);
          throw new Exception(ERR_QUERY);
      }
      $resultArray = array();
      while ( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC ) &amp;&amp; $fetchLimit &gt; 0)
      {
          Logger::logg("ROW: " . var_export($row, true), LV);
          $resultArray[] = $row;
          $fetchLimit--;
      }
      return $resultArray;
  }
  </code></pre>