DROP PROCEDURE IF EXISTS ChangePassword;
DELIMITER //
CREATE PROCEDURE ChangePassword
(
  IN p_sid INT,
  IN p_password TEXT,
  IN p_npassword TEXT,
  OUT outputCode INT
)
MODIFIES SQL DATA
BEGIN

CALL `CheckIdLogin`(p_sid,p_password, outputCode);
IF outputCode = 42 THEN 
	UPDATE membres SET hashedPassword = MD5(p_npassword) WHERE ID = p_sid;
END IF;

END//
DELIMITER ;

