title: How to find out which rows were affected after UPDATE statement inside MySQL procedure?
body: <p>How to find out affected rows after using UPDATE statements inside procedure in MySQL?(without using an API mysql_affected_rows()). Thanks!</p>
  
  <pre><code>DROP PROCEDURE IF EXISTS users_login;
  DELIMITER //
  CREATE PROCEDURE users_login(IN _id INT UNSIGNED)
      BEGIN
  
      DECLARE _error TINYINT DEFAULT FALSE;
      DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET _error = TRUE;
  
      UPDATE users SET login = NOW() WHERE id = _id;
  
      IF (_error = TRUE) THEN
          SHOW ERRORS;
      END IF;
  
      END//
  
  DELIMITER ;
  </code></pre>
  
  <p>I just want to make some check inside of the procedure.</p>