DROP PROCEDURE IF EXISTS HeaderInfos;
DELIMITER //
CREATE PROCEDURE HeaderInfos
(
  IN p_sid TEXT,
  IN p_password TEXT,
  OUT outputCode INT(11),
  OUT o_connected INT(1),
  OUT o_pseudo VARCHAR(255)
)
MODIFIES SQL DATA
BEGIN

CALL `CheckIdLogin`(p_sid,p_password, outputCode);
IF outputCode = 42 THEN 
	SELECT pseudo INTO o_pseudo FROM membres WHERE ID = p_sid;
	SET o_connected = 1;
ELSE
	SET outputCode = 42;
	SET o_connected = 0;
END IF;

END//
DELIMITER ;
