title: How to know how many mysql lines updated
body: <p>I'm going to update a lot of database lines and i want to know how many lines i've updated.</p>
  
  <p>Example : if i've database with the following 4 lines</p>
  
  <pre><code>INSERT INTO `drink` VALUES (1, 'Non-Alcoholic', 'tea');
  INSERT INTO `drink` VALUES (2, 'Non-Alcoholic', 'tea');
  INSERT INTO `drink` VALUES (3, 'Non-Alcoholic', 'coffee');
  INSERT INTO `drink` VALUES (4, 'Non-Alcoholic', 'pepsi');
  </code></pre>
  
  <p>and i'm going to make updates using the following</p>
  
  <pre><code>$sql= "update drink set cat='tea' WHERE cat= 'Non-Alcoholic' AND subcat = 'tea'"; 
  </code></pre>
  
  <p>it would be clear that it would update only 2 lines</p>
  
  <pre><code>INSERT INTO `drink` VALUES (1, 'tea', 'tea'); 
  INSERT INTO `drink` VALUES (2, 'tea', 'tea'); 
  INSERT INTO `drink` VALUES (3,'Non-Alcoholic', 'coffee'); 
  INSERT INTO `drink` VALUES (4,'Non-Alcoholic', 'pepsi');
  </code></pre>
  
  <p>Now my question how i know how many lines it have updated, i want it to be shown as message or whatever but i must know it.</p>
  
  <p>so any idea or how to do it
  thank you for help</p>