title: mysqli_affected_rows for UPDATE sometimes returns 0 on full row match
body: <p>Say, if I have MySQL query to update a row:</p>
  
  <pre><code>$res = mysqli_query($link, 
      "UPDATE table SET val=1 WHERE id=5");
  
  if($res)
  {
      if(mysqli_affected_rows($link) &gt; 0)
      {
          echo("Updated something!");
      }
      else
          echo("Didn't update");
  }
  else
      echo("Error");
  </code></pre>
  
  <p>How do I change it to distinguish between these 3 conditions:</p>
  
  <ol>
  <li>Found item with <code>id=5</code> and set it.</li>
  <li>Did not find item with <code>id=5</code>.</li>
  <li>Error</li>
  </ol>
  
  <p>In the way it's written now, if my database column <code>val</code> already has <code>1</code> in that row, <code>mysqli_affected_rows</code> will return 0.</p>