title: PHP - Get affected rows in ADODB
body: <p>I using ADODB to create a connection to my database. I update the data in my database, there is no error. The problem is that I can't get the number of affected rows by <code>Affected_Rows()</code>. I tried with very simple code but it is not working. Here is my code:</p>
  
  <pre><code>$sql = "UPDATE User SET Name=N'MyName' WHERE Id=1";
  $conn = new COM ("ADODB.Connection") or die("Cannot start ADO");
  $cs = "provider=sqloledb;"."server=localhost;database=Test;uid=Admin;pwd=123456;Max Pool Size=100";
  $conn-&gt;open($cs);
  
  //there is no error in connecting process. I can add, update, delete normally.
  if($conn-&gt;Execute($sql) === false)
  {
      trigger_error('Wrong SQL: ' . $sql . ' Error: ' . $conn-&gt;ErrorMsg(), E_USER_ERROR);
  }
  else 
  {
      echo $conn-&gt;Affected_Rows();  //&lt;-- Error in here
  }
  </code></pre>
  
  <p>I have read about this function in <a href="http://phplens.com/adodb/reference.functions.affected_rows.html" rel="nofollow">here</a>. My code above is almost same with example <a href="http://www.pontikis.net/blog/how-to-write-code-for-any-database-with-php-adodb" rel="nofollow">here</a>.
  Is there any other way to get the number of affected rows in ADODB-PHP?</p>