In db_shop database, create a stored procedure, is used to validate the user's login information, if the legal return 1, otherwise it returns 0, namely the input name and password, if the name and password in the table, the result output parameter is 1, otherwise 0
Create procedure proc3 (tname in varchar (30), the out result int)
The begin
If (select name, PWD from tb_user t where t.n ame=tname) then
Set the result:=1;
The else
Set the result:=0;
end if;
End
The set @ result:=1;
Call proc3 (" admin ", @ result);
Select @ the result;