How to do a return from a Stored Procedure - MySQL

1

I'm doing a login screen, but I can not return the ID of the selected user.

DELIMITER $$
USE  webnote $$
CREATE PROCEDURE login (IN email2 varchar(60), senha2 varchar(16))
    BEGIN
        if EXISTS(select id_aluno from aluno where email = email2 and senha = senha2)
        then
             select id_aluno from aluno;
        else
            select "Erro ao efetuar login!!"; 
        end if;
    END$$

DELIMITER ;

call login('[email protected]', '1234');

select @return;
    
asked by anonymous 20.11.2017 / 20:13

0 answers