title: What is the difference between mysqli_affected_rows and mysqli_num_rows?
body: <p>The <a href="http://php.net/manual/en/mysqli-result.num-rows.php" rel="nofollow">PHP docs for mysqli_num_rows</a> says</p>
  
  <blockquote>
    <p>Returns the number of rows in the result set.</p>
  </blockquote>
  
  <p>The <a href="http://php.net/manual/en/mysqli.affected-rows.php" rel="nofollow">PHP docs for mysqli_affected_rows</a> says</p>
  
  <blockquote>
    <p>Returns the number of rows affected by the last INSERT, UPDATE, REPLACE or DELETE query.</p>
  </blockquote>
  
  <p>_num_rows is called on a result, and _affected_rows is called on a connection. Since I think they do the same thing(correct this assumption if I'm wrong), I'm wondering whether one works better than the other, and which situations would call for which function.</p>
  
  <p>Aren't <em>number of rows affected</em> and <em>number of rows in the result set</em> synonymous?</p>