How to Return a Stored Procedure - Mysql

Asked

Viewed 78 times

1

I’m making a login screen, but I can’t return the selected user ID.

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;
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.