title: Using adodb-mssqlnative.inc.php with a timeout for update without any result
body: <p>I am using php5.4.38 with Apache2.2.29 on a windows server 2008 with MSSQL as Database with UTF8 fields for chinese language.</p>
  
  <p>I am using adodb and the affected driver is adodb-mssqlnative.inc.php in adodb/drivers folder. It seems that using a timeout for the connection-id for an update query, the update is not writing into database. I just build an own function to show what I am doing:</p>
  
  <pre><code>function sql_own_query($connection_id, $sql, $params) {
      $options=array('QueryTimeout' =&gt; 90);
      if (substr($sql, 0, 6) != 'select') {
          $options = array();
      }
      if (!empty($options)) {
          $result = sqlsrv_query($connection_id, $sql, $params, $options);
      } else {
          $result = sqlsrv_query($connection_id, $sql, $params);
      }
      return $result;
  }
  
  // returns query ID if successful, otherwise false
  function _query($sql,$inputarr) {
      $this-&gt;_errorMsg = false;
      if (is_array($inputarr)) {
          $rez = $this-&gt;sql_own_query($this-&gt;_connectionID,$sql,$inputarr);
          //$rez = sqlsrv_query($this-&gt;_connectionID,$sql,$inputarr);
      } else if (is_array($sql)) {
          $rez = $this-&gt;sql_own_query($this-&gt;_connectionID,$sql[1],$inputarr);
          //$rez = sqlsrv_query($this-&gt;_connectionID,$sql[1],$inputarr);
      } else {
          $rez = $this-&gt;sql_own_query($this-&gt;_connectionID,$sql, array());
          //$rez = sqlsrv_query($this-&gt;_connectionID,$sql, array());
      }
  </code></pre>
  
  <p>so what I do is: checking if its as select statement and put the $options - parameter into it. If its an update statement it will go through without a timeout parameter.</p>
  
  <p>The problem is, that with QueryTimeout set, the update query will not modify the table. So when I execute:</p>
  
  <pre><code>_query('Select ...');//Timeout is set to 90
  _query('Update ...');//Timeout is still set
  </code></pre>
  
  <p>the update statement will not have any result. The table is the same as before. The same result will happen when I enlarge the timeout to 300.</p>
  
  <p>I also tested to deactivate the ConnectionPooling as described here: <a href="https://msdn.microsoft.com/en-us/library/ff628167(v=sql.105).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/ff628167(v=sql.105).aspx</a> But without any positive result.</p>
  
  <p>So the question is: Why does an update with timeout will conclude to an empty result. The database is not showing any error, nor php and apache.</p>
  
  <p>PS: Due to the software logic, it is not possible to disable the select statement before. :)</p>
  
  <p>Thanks for any hints!</p>